Skip to content

@sentry/react-router plugin causes 5x build slowdown with Vite 8 (Rolldown) #20100

@EfstathiadisD

Description

@EfstathiadisD

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react-router

SDK Version

10.47.0

Framework Version

React 19.2.4

Link to Sentry event

No response

Reproduction Example/SDK Setup

// vite.config.ts
import { reactRouter } from "@react-router/dev/vite";
import { sentryReactRouter } from "@sentry/react-router";
import { defineConfig } from "vite";

const sentryConfig = {
  org: "your-org",
  project: "your-project",
  authToken: process.env.SENTRY_AUTH_TOKEN,
};

export default defineConfig((config) => ({
  plugins: [
    reactRouter(),
    sentryReactRouter(sentryConfig, config),
  ],
}));

Environment

  1. @sentry/react-router version: 10.47.0
  2. Vite version: 8.0.3
  3. React-router version: 7.14.0
  4. Build: Server + Client (SSR)
  5. Node version: 22.22.0

Steps to Reproduce

  1. Create a React Router v7 app with Vite 8 and SSR enabled
  2. Install @sentry/react-router
  3. Add the sentryReactRouter plugin to vite.config.ts
  4. Run npm run build (or vite build)
  5. Measure build time
  6. Remove the Sentry plugin from config and rebuild
  7. Compare build times

Expected Result

Build times with Vite 8 should be faster or comparable to Vite 7 (Rollup). Vite 8 with Rolldown is published to be 10-30x faster than Rollup.

Actual Result

With @sentry/react-router plugin:

Client: 3m 2s (Vite 8) vs 37.91s (Vite 7) = ~5x slower
SSR: 42.72s (Vite 8) vs 9.19s (Vite 7) = ~4.6x slower

Without the Sentry plugin:

Client: 3.07s ✅
SSR: 564ms ✅

(Confirming Vite 8 IS faster without Sentry)

Additional Context

App builds and runs successfully—this is a performance regression, not a functional The PLUGIN_TIMINGS warning shows heavy processing in react-router. Removing sentryReactRouter immediately restores expected Vite 8 performance gains. This blocks production use of Vite 8 since all CI/production builds need Sentry enabled. Potentially related to #14934 and #14947 (React Router + Vite 8 compatibility issues)

Priority

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

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions