Skip to content

uncaughtException: parentSpan.transaction.getDynamicSamplingContext is not a function after upgrading to latest version #7073

Closed
@jcasner

Description

@jcasner

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/node

SDK Version

7.36.0

Framework Version

Node v16.15.1

Link to Sentry event

https://sentry.io/organizations/trayt/issues/3920849890/?query=is%3Aunresolved&referrer=issue-stream

SDK Setup

Sentry.init({
  dsn: config.sentry.dsn,
  environment: config.sentry.environment,
  enabled: config.isRunningOnServer,
  integrations: [
    // enable HTTP calls tracing
    new Sentry.Integrations.Http({ tracing: true }),
    // enable Express.js middleware tracing
    new Tracing.Integrations.Express({
      // to trace all requests to the default router
      app,
    }),
  ],
  release: VERSION,
  tracesSampleRate: config.sentry.tracesSampleRate,
})

Steps to Reproduce

  1. Upgrade from Sentry 7.11.1
  2. Start server
  3. See server crash

Expected Result

Server starts successfully

Actual Result

Server halts soon after starting. Interestingly, Sentry still captures the exception, so it is initializing.

uncaughtException: parentSpan.transaction.getDynamicSamplingContext is not a function
TypeError: parentSpan.transaction.getDynamicSamplingContext is not a function
    at Object.wrappedMethod [as request] (/opt/trayt/node_modules/@sentry/node/cjs/integrations/http.js:167:69)
    at makeRequest (/opt/trayt/node_modules/dd-trace/packages/dd-trace/src/exporters/common/request.js:127:24)
    at request (/opt/trayt/node_modules/dd-trace/packages/dd-trace/src/exporters/common/request.js:150:3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nodeIssues related to the Sentry Node SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions