-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
RouterPath deprecation warning when using Fastify integration on 404 #12844
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
Labels
Comments
Hi, thanks for writing in. Feel free to open a PR! In case you don't end up doing so, please let us know so we can start fixing this. Thanks! |
2 tasks
Closing as "duplicate" of #15542 which will solve this! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
8.16.0
Framework Version
Fastify 4.25.2
Link to Sentry event
No response
SDK Setup/Reproduction Example
Steps to Reproduce
Expected Result
No deprecation warnings
Actual Result
The following warning:
[FSTDEP017] DeprecationWarning: You are accessing the deprecated "request.routerPath" property. Use "request.routeOptions.url" instead. Property "req.routerPath" will be removed in
fastify@5
.Caused by this line of code: const routeName = reqWithRouteInfo.routeOptions?.url || reqWithRouteInfo.routerPath;
In 404 errors, routeOptions?.url is undefined so it falls back to routerPath which is deprecated. The OpenTelemetry code that this line was based on has already been fixed in this PR (open-telemetry/opentelemetry-js-contrib@18ae75c#diff-b4262d2d3aefe5f35cfe70e34be5b0bd7324b1623cec94fdf8d2253c9cf9db89R281). Should be a fairly trivial fix - happy to submit a PR as well but not sure what's the best way forward so filing an issue first.
The text was updated successfully, but these errors were encountered: