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

Not all libs from externals end up packaged in my lambda function #367

Closed
gligorkot opened this issue Nov 27, 2023 · 1 comment · Fixed by #368
Closed

Not all libs from externals end up packaged in my lambda function #367

gligorkot opened this issue Nov 27, 2023 · 1 comment · Fixed by #368
Labels
enhancement New feature or request

Comments

@gligorkot
Copy link
Contributor

I declare 3 packages in my externals list, but only 2 of them get included in the zip package of my lambda function.

The packages in question are:

  • canvas
  • chart.js
  • chartjs-node-canvas

I believe the issue is that chartjs-node-canvas has canvas as a dependency, but chart.js as a peer dependency. When I run serverless package I get a warning

WARNING: Could not check for peer dependencies of chartjs-node-canvas. Set nodeModulesRelativeDir if node_modules is in different directory.

I believe if nodeModulesRelativeDir is exposed as an additional webpack config we can modify via serverless-bundle, I'd be able to configure it to correctly pull through the peer dependency chart.js as well.

@gligorkot
Copy link
Contributor Author

I believe this was caused because my services are part of a monorepo. I've now exposed this setting via serverless-bundle config and it's working! I'll send a PR soon.

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

Successfully merging a pull request may close this issue.

2 participants