Skip to content

Commit 37a55e3

Browse files
authored
fix: if we are in SAP mode, always render the index.html for hydration (#12268)
1 parent 4c46685 commit 37a55e3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/serious-ravens-appear.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-router/dev": patch
3+
---
4+
5+
if we are in SAP mode, always render the `index.html` for hydration

packages/react-router-dev/vite/plugin.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,10 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = (_config) => {
12241224
serverBuildDirectory,
12251225
clientBuildDirectory
12261226
);
1227-
} else if (!ctx.reactRouterConfig.ssr) {
1227+
}
1228+
1229+
// If we are in SPA mode, *always* generate the `index.html` that can be served at any location for hydration.
1230+
if (!ctx.reactRouterConfig.ssr) {
12281231
await handleSpaMode(
12291232
viteConfig,
12301233
ctx.reactRouterConfig,

0 commit comments

Comments
 (0)