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

node_modules not included in the function code uploads #30

Closed
JL102 opened this issue Jan 28, 2023 · 2 comments
Closed

node_modules not included in the function code uploads #30

JL102 opened this issue Jan 28, 2023 · 2 comments

Comments

@JL102
Copy link

JL102 commented Jan 28, 2023

Hiya,

When uploading with serverless deploy (and/or with serverless deploy function --function svelte && serverless deploy function --function cfLambda && serverless s3deploy), it seems that it doesn't include node_modules in the uploaded content. This leads to all of my imported modules failing to load.

Example: (this is my database utilities package)
image

Is there something I can do during the build step to get node_modules included in the build output? Does esbuild support some sort of tree shaking where it includes only the dependencies that are needed?

@yarbsemaj
Copy link
Owner

Hi @JL102.
It shouldn't need to be includes as part of the build process within index.js all node modules are bundled by es build into the one file

@JL102
Copy link
Author

JL102 commented Jan 28, 2023

Oh you're right. I need to figure out what's going wrong..... Now it's giving me an error "result not defined" and I dunno why it's changed.

Wish there was a way to see a stack trace.

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

2 participants