-
Notifications
You must be signed in to change notification settings - Fork 161
Closed
Labels
blockedThis item's progress is blocked by external dependency or reasonThis item's progress is blocked by external dependency or reasonbug-upstreamThis item is related to a bug caused by upstream dependencyThis item is related to a bug caused by upstream dependencyduplicateThis issue is a duplicate of an existing oneThis issue is a duplicate of an existing onetracerThis item relates to the Tracer UtilityThis item relates to the Tracer Utility
Description
Bug description
If you enable "ESM" bundling with NodejsFunction you get this error:
{
"errorType": "Error",
"errorMessage": "Dynamic require of \"util\" is not supported",
"stack": [
"Error: Dynamic require of \"util\" is not supported",
" at file:///var/task/index.mjs:1:820",
" at null.<anonymous> (/node_modules/cls-hooked/context.js:4:14)",
" at file:///var/task/index.mjs:1:1067",
" at null.<anonymous> (/node_modules/aws-xray-sdk-core/dist/lib/context_utils.js:5:11)",
" at file:///var/task/index.mjs:1:1067",
" at null.<anonymous> (/node_modules/aws-xray-sdk-core/dist/lib/aws-xray.js:2:20)",
" at file:///var/task/index.mjs:1:1067",
" at null.<anonymous> (/node_modules/aws-xray-sdk-core/dist/lib/index.js:3:18)",
" at file:///var/task/index.mjs:1:1067",
" at null.<anonymous> (/node_modules/@aws-lambda-powertools/tracer/src/provider/ProviderService.ts:4:1)"
]
}
Expected Behavior
Would like to use xray with ESM.
Steps to Reproduce
I'm using middy with the tracer middleware. I get the above error when I set
format: OutputFormat.ESM
Environment
- Powertools version used: 0.3.3
- Packaging format (Layers, npm): nodejsfunction
- AWS Lambda function runtime: node 14
- Debugging logs:
Related issues, RFCs
Metadata
Metadata
Assignees
Labels
blockedThis item's progress is blocked by external dependency or reasonThis item's progress is blocked by external dependency or reasonbug-upstreamThis item is related to a bug caused by upstream dependencyThis item is related to a bug caused by upstream dependencyduplicateThis issue is a duplicate of an existing oneThis issue is a duplicate of an existing onetracerThis item relates to the Tracer UtilityThis item relates to the Tracer Utility