-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot convert undefined or null to object #5501
Comments
Quick update: I checked the router instrumentation with Express 5 and it seems like it'll be a little more work to properly support early URL paramterization in Express 5 (which is what we wanted to achieve in #5450). So for now we'll bail out if we detect that the router from Express 4 isn't available. So for Express 5 users, nothing will change compared to how it was in v7.7.0. We'll discuss proper Express 5 internally and see how this work fits into our time schedule. |
Hotfixes a problem in our router instrumentation introduced in #5450 which would cause Express 5 Node apps to crash on startup. Because the internals of Express 5 (which is still in beta) have changed quite a bit compared to Express 4, there is unfortunately no quick way of supporting the new version in our current router instrumentation. Therefore, this patch simply checks if the router we retrieve from Express 4 apps (which we get from `app._router`) exists. In case it does, we can patch it; in case it doesn't, we know that the integration is either used with Express 3 or 5. In both cases, we early return and do not patch the router. We can revisit adding proper support for early URL parameterization of Express 5 apps but for now, this PR will unblock Express 5 users by skipping instrumentation. This means that for Express 5, we fall back to our old way of instrumenting routes (which means we get paramterized routes for transaction names but only after the route handler was executed and the transaction is finished). fixes #5501
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.8.0
Framework Version
express 5.0.0-beta.1
Link to Sentry event
No response
Steps to Reproduce
After ugprading
@sentry/integrations
,@sentry/node
, and@sentry/tracing
from version 7.7.0 to 7.8.0, my application no longer starts up.Expected Result
It should continue to work as in version 7.7.0.
Actual Result
The text was updated successfully, but these errors were encountered: