diff --git a/src/router.tsx b/src/router.tsx index 7bcb6a98d..390d7af22 100644 --- a/src/router.tsx +++ b/src/router.tsx @@ -5,7 +5,10 @@ import { DefaultCatchBoundary } from './components/DefaultCatchBoundary' import { NotFound } from './components/NotFound' import { QueryClient } from '@tanstack/react-query' import * as Sentry from '@sentry/tanstackstart-react' -import { installStaleAppReloadHandlers } from './utils/stale-app-reload' +import { + installStaleAppReloadHandlers, + staleAppErrorPatterns, +} from './utils/stale-app-reload' import { redactByokRequestHeaders } from './utils/sentry-redaction' if (typeof document !== 'undefined') { @@ -14,6 +17,7 @@ if (typeof document !== 'undefined') { Sentry.init({ dsn: 'https://ac4bfc43ff4a892f8dc7053c4a50d92f@o4507236158537728.ingest.us.sentry.io/4507236163649536', sendDefaultPii: true, + ignoreErrors: staleAppErrorPatterns, // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled diff --git a/src/utils/stale-app-reload.ts b/src/utils/stale-app-reload.ts index 6dabf188b..2dc204486 100644 --- a/src/utils/stale-app-reload.ts +++ b/src/utils/stale-app-reload.ts @@ -6,7 +6,7 @@ import { const staleAppReloadKey = 'tanstack-stale-app-reload-at' const staleAppReloadWindowMs = 10_000 -const staleAppErrorPatterns = [ +export const staleAppErrorPatterns = [ 'ChunkLoadError', 'Failed to fetch dynamically imported module', 'Importing a module script failed',