Skip to content

The requested module '@sentry/react-router' does not provide an export named 'ErrorBoundary' #18179

@pcdotfan

Description

@pcdotfan

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/react-router

SDK Version

10.25.0

Framework Version

React Router 7.9.2 (Node v22.20.0 / macOS / pnpm v9.9.0 / vite v7.1.7)

Link to Sentry event

No response

Reproduction Example/SDK Setup

https://stackblitz.com/edit/vitejs-vite-dz1cpmk3?file=app%2Fwelcome%2Fwelcome.tsx

Steps to Reproduce

Simply:

import { ErrorBoundary } from '@sentry/react-router';

export function ViewCount() {
  return (
    <ErrorBoundary fallback={<></>}>
      <div />
    </ErrorBoundary>
  );
}

// or

import * as Sentry from '@sentry/react-router';

export function ViewCount() {
  return (
    <Sentry.ErrorBoundary fallback={<></>}>
      <div />
    </Sentry.ErrorBoundary>
  );
}

Expected Result

Should work.

Actual Result

But we got:

[vite] The requested module '@sentry/react-router' does not provide an export named 'ErrorBoundary'

Additional Context

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions