Skip to content
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

claudia pack does not work with npm workspaces #221

Open
mdesousa opened this issue Dec 29, 2020 · 0 comments
Open

claudia pack does not work with npm workspaces #221

mdesousa opened this issue Dec 29, 2020 · 0 comments

Comments

@mdesousa
Copy link

  • Expected behaviour: I am using npm 7 workspaces. When I run claudia pack with a module that depends on workspaces, I expect those workspaces to be included in the node_modules folder.

  • What actually happens: workspaces are missing in the zip file created by claudiajs. When the lambda is deployed to AWS, you get errors: "Runtime.ImportModuleError: Cannot find module 'xyz'"

  • Steps to reproduce the problem: create a project that uses npm workspaces (see https://docs.npmjs.com/cli/v7/using-npm/workspaces). Create a "common" module and a "lambda" module that depends on "common". List them as workspaces in the root package.json. Make sure that "lambda" invokes a function exported from "common". Use "claudia pack" to zip and deploy the lambda function.

  • Workaround: if you explicitly declare "common" in the dependencies section of lambda/package.json then everything works as expected. However, this eliminates part of the benefits of npm workspaces where these dependencies are not required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant