generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 181
Closed
Labels
need-responseThis item requires a response from a customer and will considered stale after 2 weeksThis item requires a response from a customer and will considered stale after 2 weeksnot-a-bugNew and existing bug reports incorrectly submitted as bugNew and existing bug reports incorrectly submitted as bugtracerThis item relates to the Tracer UtilityThis item relates to the Tracer Utility
Description
Expected Behaviour
ESM Lambda function with Tracer enabled should be invoked without error
Current Behaviour
Lambda invocation error received:
{
"errorType": "Error",
"errorMessage": "Dynamic require of \"util\" is not supported",
"trace": [
"Error: Dynamic require of \"util\" is not supported",
" at file:///var/task/index.mjs:1:382",
" at <anonymous> (/node_modules/cls-hooked/context.js:4:14)",
" at file:///var/task/index.mjs:1:458",
" at <anonymous> (/node_modules/aws-xray-sdk-core/dist/lib/context_utils.js:5:11)",
" at file:///var/task/index.mjs:1:458",
" at <anonymous> (/node_modules/aws-xray-sdk-core/dist/lib/aws-xray.js:2:20)",
" at file:///var/task/index.mjs:1:458",
" at <anonymous> (/node_modules/aws-xray-sdk-core/dist/lib/index.js:3:18)",
" at file:///var/task/index.mjs:1:458",
" at <anonymous> (/node_modules/@aws-lambda-powertools/tracer/lib/esm/provider/ProviderService.js:1:21)"
]
}
Code snippet
Lambda function with following configuration in CDK app (some options removed for brevity):
new NodejsFunction(this, "MyFunction", {
architecture: Architecture.ARM_64,
bundling: {
format: OutputFormat.ESM,
},
runtime: Runtime.NODEJS_20_X,
tracing: Tracing.ACTIVE,
})Steps to Reproduce
- Deploy an ESM Lambda function with Tracer
- Invoke function
- Observe error
Possible Solution
No response
Powertools for AWS Lambda (TypeScript) version
latest
AWS Lambda function runtime
20.x
Packaging format used
npm
Execution logs
No response
Metadata
Metadata
Assignees
Labels
need-responseThis item requires a response from a customer and will considered stale after 2 weeksThis item requires a response from a customer and will considered stale after 2 weeksnot-a-bugNew and existing bug reports incorrectly submitted as bugNew and existing bug reports incorrectly submitted as bugtracerThis item relates to the Tracer UtilityThis item relates to the Tracer Utility
Type
Projects
Status
Shipped