We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Sentry Saas (sentry.io)
@sentry/react
7.15.0
17.0.2
No response
BrowserTracing
Sentry.init({ dsn: process.env.REACT_APP_SENTRY_DSN, integrations: [ new BrowserTracing({ routingInstrumentation: Sentry.reactRouterV6Instrumentation( useEffect, useLocation, useNavigationType, createRoutesFromChildren, matchRoutes, ), }), new ExtraErrorDataIntegration(), new OfflineIntegration(), postHogIntegration ], tracesSampleRate: 1.0, }); 2. Wrap react-router `useRoutes`: ```js const useSentryRoutes = Sentry.wrapUseRoutes(useRoutes); const App = () => { return useSentryRoutes(routes); }
const routes = [ { path: "/", element: <NavBarLayout/>, children: [ { path: "tests", children: [ {index: true, element: <TestComponent />}, {path: ":testId/*",element: <OtherTestComponent />}, ] }, {path: "/", element: <Navigate to="/home"/>}, {path: "*", element: <Navigate to="/404" replace/>}, ], }, { path: "/", element: <MainLayout/>, children: [ {path: "404", element: <Error />}, {path: "*", element: <Navigate to="/404" replace/>}, ], }, ];
Traces with the url template to be /tests/:testId when I navigate to /tests/123 and /tests when I navigate to /tests
/tests/:testId
/tests/123
/tests
Traces with the url template of /:testId/* when I navigate to /tests/123 and //tests when I navigate to /tests
/:testId/*
//tests
The text was updated successfully, but these errors were encountered:
Workaround for now is to remove the root paths and duplicate the wildcard children:
const routes = [ { - path: "/", element: <NavBarLayout/>, children: [ { path: "tests", children: [ {index: true, element: <TestComponent />}, + {path: ":testId",element: <OtherTestComponent />}, {path: ":testId/*",element: <OtherTestComponent />}, ] }, {path: "/", element: <Navigate to="/home"/>}, {path: "*", element: <Navigate to="/404" replace/>}, ], }, { - path: "/", element: <MainLayout/>, children: [ {path: "404", element: <Error />}, {path: "*", element: <Navigate to="/404" replace/>}, ], }, ];
Sorry, something went wrong.
AbhiPrasad
Successfully merging a pull request may close this issue.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/react
SDK Version
7.15.0
Framework Version
17.0.2
Link to Sentry event
No response
Steps to Reproduce
BrowserTracing
intergation:Expected Result
Traces with the url template to be
/tests/:testId
when I navigate to/tests/123
and/tests
when I navigate to/tests
Actual Result
Traces with the url template of
/:testId/*
when I navigate to/tests/123
and//tests
when I navigate to/tests
The text was updated successfully, but these errors were encountered: