-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
@sentry/react-router plugin causes 5x build slowdown with Vite 8 (Rolldown) #20100
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
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
- @sentry/react-router version: 10.47.0
- Vite version: 8.0.3
- React-router version: 7.14.0
- Build: Server + Client (SSR)
- Node version: 22.22.0
Steps to Reproduce
- Create a React Router v7 app with Vite 8 and SSR enabled
- Install @sentry/react-router
- Add the sentryReactRouter plugin to vite.config.ts
- Run npm run build (or vite build)
- Measure build time
- Remove the Sentry plugin from config and rebuild
- 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
Fields
Give feedbackProjects
Status