Description
Describe the bug
After #23677 was merged, our builds started failing. That's because this PR imports the randomUUID
method from the Node crypto
package, which does not exist on Node 14:
Expected Behavior
I didn't expect this new build to break our deployments. The README currently specifies that you can use Node 14.15.0 or higher:
Line 24 in 070f5ec
However, Node 14 does not have the randomUUID
method:
/tmp node
Welcome to Node.js v14.16.0.
Type ".help" for more information.
> const crypto = require('crypto')
undefined
> crypto.randomUUID
undefined
Note that Node 16+ does have that method:
/tmp node
Welcome to Node.js v16.14.0.
Type ".help" for more information.
> const crypto = require('crypto')
undefined
> crypto.randomUUID
[Function: randomUUID]
Current Behavior
Our build fails with this error message:
[25%] fail: (0 , import_crypto2.randomUUID) is not a function
[50%] fail: (0 , import_crypto2.randomUUID) is not a function
Reproduction Steps
Publish any CDK zip asset that executes the changes added with this commit: 18e0481
Possible Solution
If Node 14 is no longer supported, the docs should be updated. If Node 14 is still supported, you should polyfill this method.
Additional Information/Context
No response
CDK CLI Version
2.61.1
Framework Version
No response
Node.js Version
14.15.0
OS
Linux
Language
Python
Language Version
No response
Other information
No response
Activity
blimmer commentedon Jan 26, 2023
cc @rscharer, the author of the original PR and @rix0rrr, the approver.
fix(cdk-assets): packaging assets is broken on Node older than 14.17 (#…
github-actions commentedon Feb 3, 2023
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
fix(cdk-assets): packaging assets is broken on Node older than 14.17 (#…