-
-
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: partialRoute.split is not a function when using array as path argument #5489
Comments
Hey, thanks for writing in. We are aware of the issue and will be posting a fix soon. Thanks! |
Hi @albanv, I started looking into this. Can you confirm that before 7.8.0, for the route array you posted, route.get(['path', 'other_path', /regex_path/], (req, res, next) => {...}) your transaction names would look like this:
If yes, is this what you'd expect? Or would you expect to only get the part of the route that was actually matched (e.g. |
Hi @Lms24, yes, the transaction names looked like what you say. |
Thanks for your feedback @albanv. I agree, the matched part would probably be better to get as a transaction name. However, I think we need more feedback and time to think about this before doing anything in that regard. But we can come back and revisit this. For the moment, I'm just gonna fix the error (see linked PR above). I don't think we'll be able to provide both (or highlight the matched part as suggested) easily as this requires a lot of changes in different parts and teams. However, we could for example use the matched part as the transaction name and add the whole array to the event context. Just leaving some more context here in for future readers: To find out which item in the routes array would actually match, we'd need to match each individual item against the incoming path to figure this out. Express internally doesn't care which part matched because upon layer creation it just throws all array items into one regex and matches raw paths against this regex. So we'd have to do the matching ourselves. There are a few options how to do this:
|
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/tracing
SDK Version
7.8.0
Framework Version
express 4.18.1, node 18.7.0
Link to Sentry event
https://sentry.io/organizations/eatwith/issues/3461507981/
Steps to Reproduce
route.get(['path', 'other_path', /regex_path/], (req, res, next) => {...
As discussed in #5481 with @Lms24, in express arrays are also valids path parameters.
#5483 only fix the issue when using RegExp as path parameter.
Expected Result
The route handler should execute its actual logic
Actual Result
Sentry tracing express integration does crash
The text was updated successfully, but these errors were encountered: