Skip to content

Express Integration is not exported #11925

@Igor-Lopes

Description

@Igor-Lopes

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

5.3.0

Framework Version

express 4.15.13

Link to Sentry event

No response

SDK Setup

  Sentry.init({
    dsn: 'https://',
    integrations: [
      new Sentry.Integrations.Http({ tracing: true }),
      new Sentry.Integrations.Express({ app }),
      nodeProfilingIntegration()
    ],

    // Performance Monitoring
    tracesSampleRate: 1.0, //  Capture 100% of the transactions
    // Set sampling rate for profiling - this is relative to tracesSampleRate
    profilesSampleRate: 1.0
  })

  app.use(Sentry.Handlers.requestHandler())
  app.use(Sentry.Handlers.tracingHandler())
  app.use(Sentry.Handlers.errorHandler()) 

Steps to Reproduce

  1. Try to setup Sentry for Express.js just like instructed from Sentry Dashboard
  2. You'll get this error: TypeError: Sentry.Integrations.Express is not a constructor
  3. If you remove this line new Sentry.Integrations.Express({ app }), app will not break.

Expected Result

Sentry Express Integration should work.

Actual Result

TypeError: Sentry.Integrations.Express is not a constructor.

Captura de Tela 2024-05-06 às 21 27 43

It seems like Express Integration is not exported. You can easily check this by calling console.log(Sentry). Express is not available under Integrations objects. That's why new Sentry.Integrations.Http({ tracing: true }) will work, but new Sentry.Integrations.Express({ app }) won't. If you see the result of this log, Http integration is exported, thus, working.

Captura de Tela 2024-05-06 às 21 27 07

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugPackage: nodeIssues related to the Sentry Node SDK

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions