You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: