-
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
lambda-nodejs: Bundling fails pnpm version >= 8.4.0 #26478
Labels
@aws-cdk/aws-lambda-nodejs
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Comments
damienhill
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Jul 24, 2023
damienhill
added a commit
to damienhill/aws-cdk
that referenced
this issue
Jul 24, 2023
Fixed location of -f flag in rm command for pnpm esbuild bundling step when removing node_modules/.modules.yaml from output dir. Signed-off-by: Damien Hill <[email protected]>
Thank you for handling this |
mergify bot
pushed a commit
that referenced
this issue
Jul 24, 2023
Fix issue with order of `-f` flag and file path in `rm` command for `pnpm` esbuild bundling step to remove `node_modules/.modules.yaml` from output dir. This is continuing to cause bundling step to fail for `pnpm` >= 8.4.0 with no external `node_modules` specified per issue #26478. Solved by moving the `-f` flag before file path in the `rm` command and updating relevant unit test. Please note that I haven't adjusted the `del` command for windows env as not sure if same issue occurs in that env. Exemption Request: No changes to integration test output of `aws-lambda-nodejs/test/integ.dependencies-pnpm.js` and don't feel this warrants a separate integration test. Closes #26478. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
bmoffatt
pushed a commit
to bmoffatt/aws-cdk
that referenced
this issue
Jul 29, 2023
Fix issue with order of `-f` flag and file path in `rm` command for `pnpm` esbuild bundling step to remove `node_modules/.modules.yaml` from output dir. This is continuing to cause bundling step to fail for `pnpm` >= 8.4.0 with no external `node_modules` specified per issue aws#26478. Solved by moving the `-f` flag before file path in the `rm` command and updating relevant unit test. Please note that I haven't adjusted the `del` command for windows env as not sure if same issue occurs in that env. Exemption Request: No changes to integration test output of `aws-lambda-nodejs/test/integ.dependencies-pnpm.js` and don't feel this warrants a separate integration test. Closes aws#26478. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This was referenced Aug 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-lambda-nodejs
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Describe the bug
Previous issue #25612.
When bundling a lambda function using
lambda_nodejs
with no dependencies and withpnpm
version8.4.0
or higher the bundling process fails as therm
command doesn't correctly handle missing file.My recent pull request to fix this was merged into release 2.88.0 but unfortunately failed to resolve issue as the
-f
flag was appended after the path which still throws an error when file doesn't exist.Expected Behavior
The bundling succeeds (no need to delete this file).
Current Behavior
Bundling fails with error:
Reproduction Steps
Simple lambda construct :
/lambda/package.json
/lambda/src/index.ts
/package.json
pnpm version:
Possible Solution
In the bundling.ts source file the
-f
flag should come before the path in therm
command so the command doesn't error on file not existing.aws-cdk/packages/aws-cdk-lib/aws-lambda-nodejs/lib/bundling.ts
Additional Information/Context
The pnpm v8.0.4 release note specifies clearly :
CDK CLI Version
2.88.0 (build 5d497f9)
Framework Version
No response
Node.js Version
v16.19.1
OS
macOs 13.3.1 (22E261)
Language
Typescript
Language Version
TypeScript (5.0.4)
Other information
No response
The text was updated successfully, but these errors were encountered: