From 175bea4a1dd2796ecf43b1348bf5456066d5678e Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Wed, 8 Oct 2025 09:42:31 -0700 Subject: [PATCH 1/3] fix(sdk): Disable react rouer integration in dev mode Seems to block main thread for long periods with react 19.2 in dev mode --- static/app/bootstrap/initializeSdk.tsx | 31 ++++++++++++++------------ 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/static/app/bootstrap/initializeSdk.tsx b/static/app/bootstrap/initializeSdk.tsx index 85f762fdf96281..c18c5d3ca0af93 100644 --- a/static/app/bootstrap/initializeSdk.tsx +++ b/static/app/bootstrap/initializeSdk.tsx @@ -8,7 +8,7 @@ import { import type {Event} from '@sentry/core'; import * as Sentry from '@sentry/react'; -import {SENTRY_RELEASE_VERSION, SPA_DSN} from 'sentry/constants'; +import {NODE_ENV, SENTRY_RELEASE_VERSION, SPA_DSN} from 'sentry/constants'; import type {Config} from 'sentry/types/system'; import {addExtraMeasurements, addUIElementTag} from 'sentry/utils/performanceForSentry'; import normalizeUrl from 'sentry/utils/url/normalizeUrl'; @@ -57,18 +57,21 @@ function getSentryIntegrations() { // 6 is arbitrary, seems like a nice number depth: 6, }), - Sentry.reactRouterV6BrowserTracingIntegration({ - useEffect, - useLocation, - useNavigationType, - createRoutesFromChildren, - matchRoutes, - _experiments: { - enableStandaloneClsSpans: true, - enableStandaloneLcpSpans: true, - }, - linkPreviousTrace: 'session-storage', - }), + // Blocks main thread for long periods with react 19.2 in dev mode + NODE_ENV === 'production' + ? Sentry.reactRouterV6BrowserTracingIntegration({ + useEffect, + useLocation, + useNavigationType, + createRoutesFromChildren, + matchRoutes, + _experiments: { + enableStandaloneClsSpans: true, + enableStandaloneLcpSpans: true, + }, + linkPreviousTrace: 'session-storage', + }) + : null, Sentry.browserProfilingIntegration(), Sentry.thirdPartyErrorFilterIntegration({ filterKeys: ['sentry-spa'], @@ -76,7 +79,7 @@ function getSentryIntegrations() { }), Sentry.featureFlagsIntegration(), Sentry.consoleLoggingIntegration(), - ]; + ].filter(Boolean); return integrations; } From cd756647e049a282d1daaf2f6fa2ba309ff8757d Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Wed, 8 Oct 2025 09:46:17 -0700 Subject: [PATCH 2/3] oh right we don't have filter boolean setup --- static/app/bootstrap/initializeSdk.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/bootstrap/initializeSdk.tsx b/static/app/bootstrap/initializeSdk.tsx index c18c5d3ca0af93..2b9c20933cc06b 100644 --- a/static/app/bootstrap/initializeSdk.tsx +++ b/static/app/bootstrap/initializeSdk.tsx @@ -79,7 +79,7 @@ function getSentryIntegrations() { }), Sentry.featureFlagsIntegration(), Sentry.consoleLoggingIntegration(), - ].filter(Boolean); + ].filter(x => x !== null); return integrations; } From 87083d4f47cfd3384261210b8485b84aa2430526 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Wed, 8 Oct 2025 09:47:01 -0700 Subject: [PATCH 3/3] whole words --- static/app/bootstrap/initializeSdk.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/bootstrap/initializeSdk.tsx b/static/app/bootstrap/initializeSdk.tsx index 2b9c20933cc06b..d9547c15f9cce8 100644 --- a/static/app/bootstrap/initializeSdk.tsx +++ b/static/app/bootstrap/initializeSdk.tsx @@ -79,7 +79,7 @@ function getSentryIntegrations() { }), Sentry.featureFlagsIntegration(), Sentry.consoleLoggingIntegration(), - ].filter(x => x !== null); + ].filter(integration => integration !== null); return integrations; }