Skip to content

Surface Expo Router's ErrorBoundary and route-level errors #6160

Closed

Description

@alwx

Expo Router exports its own ErrorBoundary from each route file (see samples/expo/app/_layout.tsx: export { ErrorBoundary } from 'expo-router';). The SDK currently does nothing to capture errors that hit that boundary — users get the Expo Router fallback UI but Sentry only sees the error if the global error handler catches it. We also export Sentry.ErrorBoundary / withErrorBoundary but it's a generic React boundary, unrelated to Expo Router's per-route boundary.

Provide a wrapped ErrorBoundary re-export (e.g. Sentry.wrapRouterErrorBoundary or auto-wrapped when the integration loads) that:

  • Captures the error with route context (route.name, route.path, route.params) attached.
  • Marks the in-flight navigation transaction (if any) as errored.
  • Adds a breadcrumb for the boundary fallback render.

Investigate whether the Metro/Babel plugin (tools/metroconfig.ts) can auto-instrument re-exports of ErrorBoundary from expo-router without requiring the user to change their code.

Activity

  1. linear-code commented on May 18, 2026

    @linear-code
  2. self-assigned this
    on Jun 15, 2026
  3. added 2 commits that reference this issue on Jun 18, 2026
    f313648
    dd81b0e
  4. added a commit that references this issue on Jun 25, 2026
    6f79f71
  5. github-actions commented on Jun 25, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #6318, which was included in the 8.16.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions