From 4a291275df3428c7937260c887bad97669bab4e4 Mon Sep 17 00:00:00 2001 From: Andrei Borza Date: Fri, 14 Nov 2025 15:41:02 +0100 Subject: [PATCH] ref(react-router): Deprecate ErrorBoundary exports The ErrorBoundary exported in the SDK only works on the client and is not intended to be used. Use react router's error boundary instead: https://docs.sentry.io/platforms/javascript/guides/react-router/#report-errors-from-error-boundaries --- packages/react-router/src/client/index.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/react-router/src/client/index.ts b/packages/react-router/src/client/index.ts index c19c3456e341..935df5fb7611 100644 --- a/packages/react-router/src/client/index.ts +++ b/packages/react-router/src/client/index.ts @@ -3,13 +3,16 @@ export * from '@sentry/browser'; export { init } from './sdk'; export { reactRouterTracingIntegration } from './tracingIntegration'; -export { - captureReactException, - reactErrorHandler, - Profiler, - withProfiler, - useProfiler, - ErrorBoundary, - withErrorBoundary, -} from '@sentry/react'; +export { captureReactException, reactErrorHandler, Profiler, withProfiler, useProfiler } from '@sentry/react'; + +/** + * @deprecated ErrorBoundary is deprecated, use react router's error boundary instead. + * See https://docs.sentry.io/platforms/javascript/guides/react-router/#report-errors-from-error-boundaries + */ +export { ErrorBoundary, withErrorBoundary } from '@sentry/react'; + +/** + * @deprecated ErrorBoundaryProps and FallbackRender are deprecated, use react router's error boundary instead. + * See https://docs.sentry.io/platforms/javascript/guides/react-router/#report-errors-from-error-boundaries + */ export type { ErrorBoundaryProps, FallbackRender } from '@sentry/react';