Open keisukekomeda opened 9 months ago
I think pnpm version can be updated to v8 because Node.js 14 has been deprecated.
Thank you for your report. Please note CDK is not fully tested with pnpm.
@pahud Thank you for your reply.
I am willing to create PR for this, but I would like to wait for more feedback from the community.
I think we can upgrade pnpm to v8. reasons...
--no-prefer-frozen-lockfile
options. codeYeah, I agree this deserves more community discussion and feedback.
Describe the bug
In Node.js 20, pnpm has a bug around node-fetch. https://github.com/pnpm/pnpm/issues/6424
This bug leads to the failure in bundling of app using native nodeModuels (like
sharp
).Expected Behavior
Successfully synth cdk app.
Current Behavior
Failed to synth cdk app, and show error.
pnpm [ERR_INVALID_THIS]: Value of "this" must be of type URLSearchParams
Reproduction Steps
Here is the minumum repro. https://github.com/keisukekomeda/aws-cdk-aws_lambda_nodejs-pnpm-repro
Possible Solution
I found that using pnpm 8.12.0 resolves the error.
As a workaround, I use a custom dockerImage for bundling. I think I'd like to update the pnpm version in default docker image.
Additional Information/Context
No response
CDK CLI Version
2.114.1 (build 02bbb1d)
Framework Version
No response
Node.js Version
v20.10.0
OS
MacOS 14.1.2(23B92)
Language
TypeScript
Language Version
TypeScript (5.2.2)
Other information
No response