-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using yarn workspaces leads to wrong behavior of some subsystems #431
Comments
I have a similar monorepo structure, where I have multiple subfolders each with their own serverless.yml and webpack configs. I'm seeing a strange issue on CircleCI. When I first run a webpack build, it seems to ignore directives in the webpack configuration file, and instead attempts to transpile files where were explicitly excluded, including files from other subdirectories. The excluded files contain issues which cause webpack to faill. The weird thing is that running the command again (i.e., I thought perhaps some state was being generated in either I'm not sure if this is related to the issue you're seeing. |
I have the same issue using |
I observe the same output, and |
I found a solution working well for me, using serverless-jetpack and serverless-scriptable-plugin |
Can someone checkout the master and check the new option |
Removed milestone until someone confirm my last comment |
I think Could it be that the yarn.lock file can't be found in the root? However, even with |
I had some success using yarn's nohoist option universally, but the yarn.lock is still not found since it's in the root. I'm not sure if it will work, but I'm going to try copying the lock file to the serverless package directory prior to packaging. |
This works for me, but it's a pretty hacky process. It would be nice if the yarn.lock location were configurable in the serverless.yml options in a similar way to the node_modules directory location. |
I'm also getting this error |
Same for me, I am using turborepo and the yarn.lock + node_modules are outside of the serverless folder. |
I got it to work with following settings: serverless.yml
webpack.config.js (all my packages are named @cr/*)
|
@sambP When you got it to work the way you showed, did you have to disable hoisting in the yarn workspace? Or is hoisting okay because you used the I got it to work by copying the yarn.lock next to the serverless.yml and disabling hoisting in the yarn workspace, but doing that way took away some of the speed benefits of the yarn workspace. |
This is a (Bug Report / Feature Proposal) (maybe both?)
Description
I use
serverless-webpack
in a monorepo with several services. My structure is something like this:Each service has is own
package.json
,serverless.yml
andwebpack.config.js
.This works so far but there are 2 issues with this setup:
I get a lot of
WARNING: Could not check for peer dependencies of <dep>
warnings. I guess this is related to this which just looks at the wrong place fornode_modules
. Inwebpack-node-externals
I can define a folder it will look into, but that feels wrong too. Maybe we need a node-like resolution algo here?If I'm using the
yarn
packager ,serverless-webpack
will not find my lockfile because its some folders upwards in the tree.I'm using the latest serverless/serverless-webpack version.
I really wonder if I should use
serverless-webpack
in this way and If so how?Thank you for all your great work in this field 👍
The text was updated successfully, but these errors were encountered: