Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/flat-shoes-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-router": patch
---

In RSC Data Mode when using a custom basename, fix hydration errors for routes that only have client loaders
2 changes: 1 addition & 1 deletion integration/helpers/rsc-vite-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@vanilla-extract/css": "^1.17.4",
"@vanilla-extract/vite-plugin": "^5.1.1",
"@vitejs/plugin-react": "^4.5.2",
"@vitejs/plugin-rsc": "0.4.25",
"@vitejs/plugin-rsc": "0.4.26",
"cross-env": "^7.0.3",
"typescript": "^5.1.6",
"vite": "^6.2.0",
Expand Down
2 changes: 1 addition & 1 deletion integration/helpers/rsc-vite-framework/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import reactRouterRequestHandler from "./build/server/index.js";

const app = express();

app.use(express.static("build/client"));
app.use(process.env.VITE_BASE || "/", express.static("build/client"));

app.get("/.well-known/appspecific/com.chrome.devtools.json", (_, res) => {
res.status(404);
Expand Down
2 changes: 1 addition & 1 deletion integration/helpers/rsc-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"typecheck": "tsc"
},
"devDependencies": {
"@vitejs/plugin-rsc": "0.4.25",
"@vitejs/plugin-rsc": "0.4.26",
"@types/express": "^5.0.0",
"@types/node": "^22.13.1",
"@types/react": "^19.1.8",
Expand Down
8 changes: 7 additions & 1 deletion integration/helpers/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,17 +337,23 @@ export const reactRouterServe = async ({
export const runStartScript = async ({
cwd,
port,
viteBase,
basename,
}: {
cwd: string;
port: number;
viteBase?: string;
basename?: string;
}) => {
let nodeBin = process.argv[0];
let proc = spawn(nodeBin, ["start.js"], {
cwd,
stdio: "pipe",
env: { NODE_ENV: "production", PORT: port.toFixed(0) },
env: {
NODE_ENV: "production",
PORT: port.toFixed(0),
VITE_BASE: viteBase,
},
});
await waitForServer(proc, { port, basename });
return () => proc.kill();
Expand Down
Loading
Loading