Title: After v8 update I receive "_matchRoutes is not a function" when using wrapCreateBrowserRouter · Issue #12018 · getsentry/sentry-javascript · GitHub
Open Graph Title: After v8 update I receive "_matchRoutes is not a function" when using wrapCreateBrowserRouter · Issue #12018 · getsentry/sentry-javascript
X Title: After v8 update I receive "_matchRoutes is not a function" when using wrapCreateBrowserRouter · Issue #12018 · 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/12018
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"After v8 update I receive \"_matchRoutes is not a function\" when using wrapCreateBrowserRouter","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/react\r\n\r\n### SDK Version\r\n\r\n8.0.0\r\n\r\n### Framework Version\r\n\r\n18.3.1\r\n\r\n### Link to Sentry event\r\n\r\n_No response_\r\n\r\n### SDK Setup\r\n\r\n```js\r\nSentry.init({\r\n dsn: '***',\r\n integrations: [\r\n Sentry.reactRouterV6BrowserTracingIntegration({\r\n useEffect,\r\n useLocation,\r\n useNavigationType,\r\n createRoutesFromChildren,\r\n matchRoutes,\r\n }),\r\n Sentry.replayIntegration(),\r\n ],\r\n tracesSampleRate: 0.1,\r\n replaysSessionSampleRate: 0.1,\r\n replaysOnErrorSampleRate: 1.0,\r\n});\r\n```\r\n\r\n### Steps to Reproduce\r\n\r\nI setup my react-router v6 as follows.\r\n\r\n```tsx\r\nexport function App() {\r\n return (\r\n \u003cRouterProvider\r\n router={Sentry.wrapCreateBrowserRouter(createBrowserRouter)([\r\n {\r\n path: '*',\r\n element: \u003cRouterEntry />,\r\n children: [\r\n /* my routes */\r\n ],\r\n },\r\n ])}\r\n />\r\n );\r\n}\r\n```\r\n\r\n### Expected Result\r\n\r\nShould load my routes 🎉 \r\n\r\n### Actual Result\r\n\r\nNo routes load, and I see the following console error. I cannot find in the [migration guide](https://docs.sentry.io/platforms/javascript/migration/v7-to-v8/#migration-codemod) any changes about this so I assume it is a bug as on v7 this code works. Removing `Sentry.wrapCreateBrowserRouter` allows the routes to load again.\r\n\r\n```\r\nUncaught (in promise) TypeError: _matchRoutes is not a function\r\n at handleNavigation (@sentry_react.js?v=aff74ec4:29421:55)\r\n at @sentry_react.js?v=aff74ec4:29508:9\r\n at react-router-dom.js?v=aff74ec4:1257:46\r\n at Array.forEach (\u003canonymous>)\r\n at updateState (react-router-dom.js?v=aff74ec4:1257:22)\r\n at completeNavigation (react-router-dom.js?v=aff74ec4:1332:5)\r\n at startNavigation (react-router-dom.js?v=aff74ec4:1507:5)\r\n```","author":{"url":"https://github.com/Slessi","@type":"Person","name":"Slessi"},"datePublished":"2024-05-14T10:00:53Z","url":"https://github.com/getsentry/sentry-javascript/issues/12018"}
| 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:6a9af113-0cb0-ce1b-b454-f99c089567d9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 91FC:2D8562:5B9C29:7CC5AD:6B04419A |
| html-safe-nonce | 8606254353591484ef9d1244b16d562a6454ee3857de0f8a6f625d52fca46ab0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MUZDOjJEODU2Mjo1QjlDMjk6N0NDNUFEOjZCMDQ0MTlBIiwidmlzaXRvcl9pZCI6IjI3NTEwMDI0ODEzMTUyOTk3MzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1f01b96baef36f1e8d91312a8cddf00feb1da954d1fc4a97cde7a3dc36cfb00e |
| hovercard-subject-tag | issue:2295004056 |
| 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/12018/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7785917d6cb7d582c640ac8025258409c6d338a2b06c26c292fe5c1990192e37/getsentry/sentry-javascript/issues/12018 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7785917d6cb7d582c640ac8025258409c6d338a2b06c26c292fe5c1990192e37/getsentry/sentry-javascript/issues/12018 |
| 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 | Slessi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64 |
| 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 | 06dc448a76fe4751ac1db26524aefa3aa3e889a8 |
| 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