-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.51.0
Framework Version
Express v5
Link to Sentry event
No response
Reproduction Example/SDK Setup
import * as Sentry from '@sentry/node'
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.SENTRY_ENVIRONMENT,
release: appVersion,
tracesSampleRate: 0.0,
})
console.log(`================================`)
console.log(`****** Sentry Initialized ******`)
console.log('================================')
export { Sentry }
Above is my sentry instrument js and I import that file in the index.js like below
import { Sentry } from './instrument.js'
I confirmed it gets the correct env values. My express version is v5. And I use esm mode to import so I run this command to import instrument.js
nodemon --import ./build/instrument.js build/index.js
When I use express v4, it worked but after migrate it shows sentry warning again
[1] [Sentry] express is not instrumented. Please make sure to initialize Sentry in a separate file that you --import when running node, see: https://docs.sentry.io/platforms/javascript/guides/express/install/esm/.
Steps to Reproduce
- Sentry init in instrument.js
- Import instrument.js in index.js
- Run script in esm mode , use --import flag to import
Expected Result
There should no sentry warning
Actual Result
[1] [Sentry] express is not instrumented. Please make sure to initialize Sentry in a separate file that you --import when running node, see: https://docs.sentry.io/platforms/javascript/guides/express/install/esm/.
There is sentry warning
Metadata
Metadata
Assignees
Labels
Projects
Status