Closed
Description
Expected Behaviour
When attaching the v2 Lambda Layer with a Lambda function that uses ESM bundles the function should work normally.
Current Behaviour
When the conditions above are met, the function crashes at startup due to the fact that the code in the Lambda Layer containing an import using the require
keyword in the Tracer provider.
The stack trace of the error suggests that the issue will happen even if a polyfill banner is used.
This seems to be due to the banner being included in the customer bundle while the layer code being evaluated/required before that.
Code snippet
N/A
Steps to Reproduce
N/A
Possible Solution
No response
Powertools for AWS Lambda (TypeScript) version
latest
AWS Lambda function runtime
20.x
Packaging format used
Lambda Layers
Execution logs
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Shipped