autoWrapExpoRouterErrorBoundary (in withSentryConfig/getSentryExpoConfig, packages/core/src/js/tools/metroconfig.ts) auto-wraps Expo Router's per-route ErrorBoundary re-exports with Sentry.wrapExpoRouterErrorBoundary at build time, so render-phase errors that hit the fallback get captured without the user touching their route files.
It currently defaults to false (#6347), so Expo Router users only get this error capture if they know the option exists and opt in explicitly:
module.exports = getSentryExpoConfig(__dirname, {
autoWrapExpoRouterErrorBoundary: true,
});
Since the whole point is capturing errors users wouldn't otherwise think to instrument, most Expo Router apps are silently missing this coverage. Worth considering flipping the default to true in the next major version.
Needs scoping before landing:
- Confirm the babel rewrite (detecting
export { ErrorBoundary } from 'expo-router' and aliased variants) is safe to apply unconditionally across the range of Expo Router versions/route layouts we support - it already skips files that already import wrapExpoRouterErrorBoundary, but should be validated against a wider set of real app structures.
- Decide whether this should ship default-on directly in 9.0, or default-on with an escape hatch (
autoWrapExpoRouterErrorBoundary: false) for a deprecation cycle.
autoWrapExpoRouterErrorBoundary(inwithSentryConfig/getSentryExpoConfig,packages/core/src/js/tools/metroconfig.ts) auto-wraps Expo Router's per-routeErrorBoundaryre-exports withSentry.wrapExpoRouterErrorBoundaryat build time, so render-phase errors that hit the fallback get captured without the user touching their route files.It currently defaults to
false(#6347), so Expo Router users only get this error capture if they know the option exists and opt in explicitly:Since the whole point is capturing errors users wouldn't otherwise think to instrument, most Expo Router apps are silently missing this coverage. Worth considering flipping the default to
truein the next major version.Needs scoping before landing:
export { ErrorBoundary } from 'expo-router'and aliased variants) is safe to apply unconditionally across the range of Expo Router versions/route layouts we support - it already skips files that already importwrapExpoRouterErrorBoundary, but should be validated against a wider set of real app structures.autoWrapExpoRouterErrorBoundary: false) for a deprecation cycle.