Skip to content

Comments

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

Open
onurtemizkan wants to merge 2 commits intomasterfrom
onur/react-router-instrumentation-api
Open

feat(react-router): Add React Router Instrumentation API support#1209
onurtemizkan wants to merge 2 commits intomasterfrom
onur/react-router-instrumentation-api

Conversation

@onurtemizkan
Copy link
Collaborator

@onurtemizkan onurtemizkan commented Jan 30, 2026

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 onurtemizkan force-pushed the onur/react-router-instrumentation-api branch 5 times, most recently from b957494 to 0d52554 Compare February 19, 2026 01:58
@onurtemizkan onurtemizkan force-pushed the onur/react-router-instrumentation-api branch from cb86202 to 2642813 Compare February 19, 2026 02:35
@onurtemizkan onurtemizkan marked this pull request as ready for review February 19, 2026 02:43
Sign up for free to 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.

1 participant