Skip to content

feat(react-router): Add React Router Instrumentation API support - #1209

Merged
chargome merged 2 commits into
masterfrom
onur/react-router-instrumentation-api
Mar 2, 2026
Merged

feat(react-router): Add React Router Instrumentation API support#1209
chargome merged 2 commits into
masterfrom
onur/react-router-instrumentation-api

Conversation

@onurtemizkan

@onurtemizkanonurtemizkan commented Jan 30, 2026

Copy link
Copy Markdown
Contributor

SDK PR: getsentry/sentry-javascript#18580

Adds wizard support for React Router's https://reactrouter.com/how-to/instrumentation
(unstable_instrumentations), available in React Router 7.9.5+.

When tracing is enabled, the wizard now asks if the user wants to use the Instrumentation API.

  • Configures entry.client.tsx with Sentry.reactRouterTracingIntegration({ useInstrumentationAPI: true }) and the unstable_instrumentations prop on <HydratedRouter>
  • Configures entry.server.tsx with a standalone unstable_instrumentations export using Sentry.createSentryServerInstrumentation()
  • Adds @sentry/react-router to Vite's optimizeDeps.exclude to prevent Vite returns 504 Outdated Optimize Dep for non-existing resource vitejs/vite#13506 in dev mode

Also fixes to the original React Router wizard:

  • async async duplication when wrapping an already-async handleRequest in entry.server.tsx
  • Missing NODE_ENV=production in the start script when --import instrumentation is used
  • E2E test runner (run.sh) substring-matching react-router against react-router-instrumentation-api.test.ts

@onurtemizkan
onurtemizkanforce-pushed the onur/react-router-instrumentation-api branch 5 times, most recently from b957494 to 0d52554CompareFebruary 19, 2026 01:58
@onurtemizkan
onurtemizkanforce-pushed the onur/react-router-instrumentation-api branch from cb86202 to 2642813CompareFebruary 19, 2026 02:35
@onurtemizkan
onurtemizkan marked this pull request as ready for review February 19, 2026 02:43
@s1gr1d
s1gr1d requested a review from chargomeFebruary 26, 2026 15:05
@chargome
chargome merged commit ac9b922 into masterMar 2, 2026
55 checks passed
@chargome
chargome deleted the onur/react-router-instrumentation-api branch March 2, 2026 11:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@onurtemizkan@chargome