Closed
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
7.74.1
Framework Version
Node v18.16.1, Express v4.18.2
Link to Sentry event
https://capdesk-org.sentry.io/issues/4568059536
SDK Setup
Sentry.init({
dsn: SENTRY_DSN,
integrations: [
new Sentry.Integrations.Http({ tracing: true }),
new Sentry.Integrations.Express({
app,
}),
],
environment: ENV,
ignoreErrors: [],
})
Steps to Reproduce
- When you provides routes to
app.use
, like so:
app.use(routes, frontendHandler)
With the frontendHandler
basically serving static assets:
express.static(path.join(__dirname, '../../build'))
- And request any frontend route
Expected Result
Routes are served normally.
Actual Result
The following error gets thrown, crashing the express server:
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at /Users/username/Code/reponame/node_modules/@sentry-internal/src/node/integrations/express.ts:439:1
at Array.forEach (<anonymous>)
at extractOriginalRoute (/Users/username/Code/reponame/node_modules/@sentry-internal/src/node/integrations/express.ts:439:1)
at getLayerRoutePathInfo (/Users/username/Code/reponame/node_modules/@sentry-internal/tracing/cjs/node/integrations/express.js:409:13)
at Function.process_params (/Users/username/Code/reponame/node_modules/@sentry-internal/src/node/integrations/express.ts:316:1)
at next (/Users/username/Code/reponame/node_modules/express/lib/router/index.js:280:10)
at Function.handle (/Users/username/Code/reponame/node_modules/express/lib/router/index.js:175:3)
at router (/Users/username/Code/reponame/node_modules/express/lib/router/index.js:47:12)
at /Users/username/Code/reponame/node_modules/@sentry-internal/src/node/integrations/express.ts:183:1
at Layer.handle [as handle_request] (/Users/username/Code/reponame/node_modules/express/lib/router/layer.js:95:5)
Seems related to this commit. Using app.all
instead works correctly, like so:
app.all(routes, frontendHandler)
Problem is that using all
and use
aren't exactly equivalent.
Metadata
Metadata
Assignees
Type
Projects
Status
Waiting for: Product Owner