Skip to content

feat(react-router): Capture server build in dev mode for middleware names#22628

Closed
chargome wants to merge 1 commit into
developfrom
feat/rr-dev-server-build-capture
Closed

feat(react-router): Capture server build in dev mode for middleware names#22628
chargome wants to merge 1 commit into
developfrom
feat/rr-dev-server-build-capture

Conversation

@chargome

Copy link
Copy Markdown
Member

Gates the server build capture Vite plugin on the transform hook's options.ssr flag instead of config.build.ssr. options.ssr is set for the SSR module in both react-router dev and production builds, so middleware names now resolve in dev mode too — previously the build-only gate skipped dev entirely.

Adds a dev-mode e2e app (react-router-7-framework-instrumentation-dev) that runs react-router dev and asserts the middleware name resolves from the captured server build. Verified it fails without the fix.

Fixes #22592

…ames

Gate the server build capture Vite plugin on the transform hook's `options.ssr`
flag instead of `config.build.ssr`. `options.ssr` is set for the SSR module in
both `react-router dev` and production builds, so middleware names now resolve in
dev mode too (previously the build-only gate skipped dev entirely).

Adds a dev-mode e2e app (`react-router-7-framework-instrumentation-dev`) that runs
`react-router dev` and asserts the middleware name resolves from the captured
server build.

Fixes #22592

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chargome chargome closed this Jul 24, 2026
@chargome
chargome deleted the feat/rr-dev-server-build-capture branch July 24, 2026 12:31
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.

Capture React Router server build in dev mode for middleware names

1 participant