You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sentry.init({dsn: 'https://',integrations: [newSentry.Integrations.Http({tracing: true}),newSentry.Integrations.Express({ app }),nodeProfilingIntegration()],// Performance MonitoringtracesSampleRate: 1.0,// Capture 100% of the transactions// Set sampling rate for profiling - this is relative to tracesSampleRateprofilesSampleRate: 1.0})app.use(Sentry.Handlers.requestHandler())app.use(Sentry.Handlers.tracingHandler())app.use(Sentry.Handlers.errorHandler())
Steps to Reproduce
Try to setup Sentry for Express.js just like instructed from Sentry Dashboard
You'll get this error: TypeError: Sentry.Integrations.Express is not a constructor
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.
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.
The text was updated successfully, but these errors were encountered:
you are using SDK version 5, which is quite old. All our docs etc. are for the current version of the SDK (v7 or very soon v8). Please update your SDK. You can find help on migrating to newer SDK versions here: https://docs.sentry.io/platforms/javascript/guides/node/migration/
Sorry I've thought it was installed the latest version. However, if you run yarn such as instructed on sentry website, it will install version 5 by default. You have to specify the latest version to force install it.
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
Steps to Reproduce
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.
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, butnew Sentry.Integrations.Express({ app })
won't. If you see the result of this log, Http integration is exported, thus, working.The text was updated successfully, but these errors were encountered: