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/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/react
SDK Version
8.47.0
Framework Version
React 19.0.0
Link to Sentry event
No response
Reproduction Example/SDK Setup
import * as Sentry from "@sentry/react";
import { useEffect, useMemo } from "react";
import {
useLocation,
useNavigationType,
createRoutesFromChildren,
matchRoutes,
createBrowserRouter,
useRouteError,
} from "react-router";
Sentry.init({
dsn: sentryDSN,
release: VERSION,
environment: env,
tracesSampleRate: 0.1,
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,
// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 0.1,
integrations: [
// Sentry.browserTracingIntegration(),
Sentry.reactRouterV7BrowserTracingIntegration({
useEffect,
useLocation,
useNavigationType,
createRoutesFromChildren,
matchRoutes,
instrumentNavigation: false,
instrumentPageLoad: false,
}),
Sentry.replayIntegration(),
],
// debug: true,
// tracePropagationTargets: ["localhost", window.location.hostname],
});
const Routes = Sentry.withSentryReactRouterV7Routing(RoutesOriginal);
Steps to Reproduce
Issue Description
- I updated and deployed the application to the staging environment.
- After deployment, I encountered a
Maximum call stack size exceeded
error consistently.
Observations
- The error occurs specifically when I wrap the
Routes
variable with theSentry.withSentryReactRouterV7Routing
wrapper. - If I use the original
Routes
value (without the Sentry wrapper), the app works as expected.
Debugging Insights
- During my debugging session, I identified the function
getChildRoutesRecursively
as the source of the issue. - The
allRoutes
array keeps increasing indefinitely, repeating the same values, which seems to cause the stack overflow.
Expected Result
No error
Actual Result
Video of the error
Metadata
Metadata
Assignees
Type
Projects
Status
No status