Skip to content

TypeError: Cannot read properties of undefined (reading 'then') #404

@chelseaharalson

Description

@chelseaharalson

Expected Behavior

No issues

Actual Behavior

When invoking my lambda function, I get this error coming from the datadog library:

TypeError: Cannot read properties of undefined (reading 'then')
,
    at /opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/lambda/handler.js:89:43
,
    at /opt/nodejs/node_modules/datadog-lambda-js/utils/handler.js:166:25
,
    at /opt/nodejs/node_modules/datadog-lambda-js/index.js:223:70
,
    at step (/opt/nodejs/node_modules/datadog-lambda-js/index.js:44:23)
,
    at Object.next (/opt/nodejs/node_modules/datadog-lambda-js/index.js:25:53)
,
    at /opt/nodejs/node_modules/datadog-lambda-js/index.js:19:71
,
    at new Promise (<anonymous>)
,
    at __awaiter (/opt/nodejs/node_modules/datadog-lambda-js/index.js:15:12)
,
    at traceListenerOnWrap (/opt/nodejs/node_modules/datadog-lambda-js/index.js:200:36)
,
    at /opt/nodejs/node_modules/dd-trace/packages/dd-trace/src/tracer.js:103:56

This just started happening yesterday. Previously it worked with no code changes.

Specifications

  • Datadog Lambda Layer version: I am using the latest version of "serverless-plugin-datadog": "5.36.0"
  • Node version: I tried both 16 and 18 - happens in both
  • I believe this pull request could have caused the issue: DataDog/dd-trace-js@1538225

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions