-
Notifications
You must be signed in to change notification settings - Fork 4k
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
NodejsFunction packages dependencies incorrectly #8031
Comments
@jogold any idea? |
This is apparently a bug when bundling |
Add a `containerEnvironment` prop to pass environment variables to the container running Parcel. Closes #8031 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I am running into this same issue. @RafalWilinski were you able to resolve this? I'm using the new esbuild now and am still running into this issue. I've also set the env var in the bundling block "bundling": {
"environment": {
"NODE_ENV": "production"
}
} |
Update: I just turned off minification in the bundling process and it seems to work now. "bundling": {
"environment": {
"NODE_ENV": "production"
},
"minify": false
} |
@jogold can you take a look? |
Seems to be related to an issue in @seawatts you can also exclude it from bundling with: bundling: {
nodeModules: ['graphql'],
}, |
NodejsFunction
from@aws-cdk/aws-lambda-nodejs
which is using Parcel to bundle dependencies does that incorrectly, I'm not sure why. I've tried putting function dependencies both at the root of the project and inside function directory.However, it works correctly when I
cd
into function directory, runNODE_ENV=production parcel build function.ts"
and point NodeJSFunctionentry
to the built function.Reproduction Steps
https://github.com/RafalWilinski/cdk-nodejs-function-parcel-bug
Error Log
After invocation:
Environment
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: