Uh oh!
There was an error while loading. Please reload this page.
feat(aws): Create unified lambda layer for ESM and CJS - #17012
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
88d24b0 to
5a9af39Compare
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
andreiborza
left a comment
There was a problem hiding this comment.
Great work, just a few minor comments. I think we can give this a spin!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
feat(aws): Create unified lambda layer for ESM and CJS
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Bug: Inconsistent Path Handling Causes Pruning Failures
The node_modules pruning logic fails due to inconsistent path formatting. Paths from @vercel/nft (based on entrypoints with ./ prefix) and paths from getAllFiles (relative to process.cwd()) do not consistently match, potentially due to leading ./ differences and platform-specific path separators. This causes the file filtering to fail, leading to incorrect pruning (e.g., deleting all files or preserving/deleting the wrong ones).
Additionally, the nodeFileTrace call lacks error handling; if any hardcoded entrypoint files are missing, it will crash the build process.
packages/aws-serverless/scripts/buildLambdaLayer.ts#L66-L78
sentry-javascript/packages/aws-serverless/scripts/buildLambdaLayer.ts
Lines 66 to 78 in 4ad4e49
Was this report helpful? Give feedback by reacting with 👍 or 👎
This introduces a new AWS lambda layer that supports both ESM and CJS. Instead of bundling the whole SDK, we install the local NPM package and then prune all not strictly necessary files from
node_modulesby using@vercel/nftto keep the layer size as small as possible.closes#16876
closes#16883
closes#16886
closes#16879