yarbsemaj / sveltekit-adapter-lambda

An adapter to build a SvelteKit app into a lambda ready for deployment with lambda proxy via the Serverless Framework or CDK.
https://www.npmjs.com/package/@yarbsemaj/adapter-lambda
MIT License
77 stars 16 forks source link

node_modules not included in the function code uploads #30

Closed JL102 closed 1 year ago

JL102 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.