Repository navigation
fix(react-router): preserve caseSensitive in createClientRoutes() and createRoutesStub() - #15808
Merged
brophdawg11 merged 2 commits intoNov 23, 2026
Conversation
… createRoutesStub()
brophdawg11
approved these changes
Nov 23, 2026
brophdawg11
left a comment
Contributor
There was a problem hiding this comment.
Verified that the Framework client routes and createRoutesStub() preserve caseSensitive. The six regressions failed before the fix and passed afterward, and the unit and Chromium suites passed on the tested merge tree.
Authored by an AI agent on behalf of @brophdawg11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15807
In Framework Mode,
@react-router/devemitscaseSensitive: route.caseSensitiveinto both the server build and the browserassetsManifest, and bothcreateStaticHandlerDataRoutes()(packages/react-router/lib/server-runtime/routes.ts) andcreateServerRoutes()(packages/react-router/lib/dom/ssr/routes.tsx) forwardcaseSensitive: route.caseSensitiveonto the createdDataRouteObject.However,
createClientRoutes()inpackages/react-router/lib/dom/ssr/routes.tsxomittedcaseSensitive:Because
<HydratedRouter>,getHydrationData(), lazy route discovery (fog-of-war.tsandroute-discovery.ts), and HMR (createClientRoutesWithHMRRevalidationOptOut()) all construct client routes throughcreateClientRoutes(), everycaseSensitive: trueroute became case-insensitive on the client, diverging from SSR and server data matching.Similarly,
processRoutes()increateRoutesStub()(packages/react-router/lib/dom/ssr/routes-test-stub.tsx) omittedcaseSensitive: route.caseSensitivewhen constructing bothnewRouteandentryRoute, even thoughStubRouteObjectacceptscaseSensitive?: boolean.This forwards
caseSensitive: route.caseSensitiveincreateClientRoutes()(matchingcreateServerRoutes()) and increateRoutesStub()'sprocessRoutes().Tests:
packages/react-router/__tests__/dom/ssr/routes-test.tsx: coverscreateClientRoutes()on critical and lazy routes compared againstcreateServerRoutes(),getHydrationData(),createClientRoutesWithHMRRevalidationOptOut(),fetchAndApplyManifestPatches(), andRouteDiscoveryRuntime.packages/react-router/__tests__/dom/stub-test.tsx: coverscreateRoutesStub()withcaseSensitive: trueroutes and a catch-all fallback.All 6 new tests fail on
main:and pass with this change (
21 passed, 21 total). Also run locally on Windows 11 with Node 24.22.1:pnpm test packages/react-router/(--maxWorkers=2, with the 14 suites that hit 5000ms timeouts under parallel load re-run cleanly via--runInBand --testTimeout=30000): all 126 suites passed (3056 passed, 15 skipped)pnpm --filter react-router exec tsc --noEmit: cleanpnpm exec eslintandpnpm exec prettier --checkon changed files: cleanpnpm run changes:validate: validpnpm run --filter react-router buildand the standalone reproduction script from createClientRoutes() and createRoutesStub() drop caseSensitive on routes #15807 againstdist/production/index.js:createClientRoutes(),getHydrationData(), andcreateRoutesStub()all respectcaseSensitive: trueAI-assisted: drafted with an AI coding agent; the tests above were run locally.