Title: RouterPath deprecation warning when using Fastify integration on 404 · Issue #12844 · getsentry/sentry-javascript · GitHub
Open Graph Title: RouterPath deprecation warning when using Fastify integration on 404 · Issue #12844 · getsentry/sentry-javascript
X Title: RouterPath deprecation warning when using Fastify integration on 404 · Issue #12844 · getsentry/sentry-javascript
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/...
Open Graph 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 th...
X 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 th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/12844
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"RouterPath deprecation warning when using Fastify integration on 404","articleBody":"### Is there an existing issue for this?\r\n\r\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\r\n- [X] I have reviewed the documentation https://docs.sentry.io/\r\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\r\n\r\n### How do you use Sentry?\r\n\r\nSentry Saas (sentry.io)\r\n\r\n### Which SDK are you using?\r\n\r\n@sentry/node\r\n\r\n### SDK Version\r\n\r\n8.16.0\r\n\r\n### Framework Version\r\n\r\nFastify 4.25.2\r\n\r\n### Link to Sentry event\r\n\r\n_No response_\r\n\r\n### SDK Setup/Reproduction Example\r\n\r\n```\r\nimport './instrument.ts';\r\nimport Fastify from \"fastify\";\r\nimport * as Sentry from \"@sentry/node\";\r\n\r\nconst app = Fastify();\r\n\r\nSentry.setupFastifyErrorHandler(app);\r\n\r\napp.listen({ port: 3030 });\r\n```\r\n\r\n### Steps to Reproduce\r\n\r\n1. Set up a standard Fastify server with Fastify tracing\r\n2. Access a 404 route that does not exist\r\n\r\n### Expected Result\r\n\r\nNo deprecation warnings\r\n\r\n### Actual Result\r\n\r\nThe following warning:\r\n\r\n[FSTDEP017] DeprecationWarning: You are accessing the deprecated \"request.routerPath\" property. Use \"request.routeOptions.url\" instead. Property \"req.routerPath\" will be removed in `fastify@5`.\r\n\r\nCaused by this line of code: [ const routeName = reqWithRouteInfo.routeOptions?.url || reqWithRouteInfo.routerPath;](https://github.com/getsentry/sentry-javascript/blob/develop/packages/node/src/integrations/tracing/fastify.ts#L82C9-L82C93)\r\n\r\nIn 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 (https://github.com/open-telemetry/opentelemetry-js-contrib/commit/18ae75c6004d66744ee99be68469843372c19d1e#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.\r\n\r\n```\r\nconst routeName = reqWithRouteInfo.routeOptions ? reqWithRouteInfo.routeOptions.url : reqWithRouteInfo.routerPath;\r\n```","author":{"url":"https://github.com/kingston","@type":"Person","name":"kingston"},"datePublished":"2024-07-10T09:00:15Z","url":"https://github.com/getsentry/sentry-javascript/issues/12844"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0f0b19e6-587b-5203-04fb-4a228891f730 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A9FA:5662:BFC44:FB465:6B04BF40 |
| html-safe-nonce | 242e2f362600df17d090029def446fc71f469dd6addb35fe249d0c41668702c0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOUZBOjU2NjI6QkZDNDQ6RkI0NjU6NkIwNEJGNDAiLCJ2aXNpdG9yX2lkIjoiMjA5MjQ2MDUyNzQxMzY3Mzc5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 69196bb22f7347f95c5bb3e0f7e5b0f9be64adf2d973bebc4b56449544ba43df |
| hovercard-subject-tag | issue:2400167887 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/12844/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0e29e587351bbad44a6509fd37950724dd39e24e127cb5b4dbb5f3fa924faddd/getsentry/sentry-javascript/issues/12844 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0e29e587351bbad44a6509fd37950724dd39e24e127cb5b4dbb5f3fa924faddd/getsentry/sentry-javascript/issues/12844 |
| og:image:alt | 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 th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kingston |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85dd75377eb77313206b8fc108bcee6a3a029286d94bf32bf9b4426e4d92e0c4 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0d64fa748a2bab9a5b587a967ac4da1cfa8da6dd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width