-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Description
Reproduction
- Get the minimal test app from https://github.com/lnxon/sibling-layout-rsc.
- Run the app (pnpm run dev)
- Enter "localhost:5173/route-a" to the browser's address bar
- Click "go to route-b" button and you see 404 Not Found
- Press F12 to see the "can't access property" error.
- Open the routes.ts
- Change the fragment commented out - activate the "routes in same layout" and comment "routes in sibling layout" out
export default [
index("routes/home.tsx"),
// routes in same layout
layout("layouts/layout-a.tsx", [route("/route-a", "routes/route-a.tsx"),
route("/route-b", "routes/route-b.tsx")
]),
// routes in sibling layout
/*
layout("layouts/layout-a.tsx", [route("/route-a", "routes/route-a.tsx")]),
layout("layouts/layout-b.tsx", [route("/route-b", "routes/route-b.tsx")]),
*/
] satisfies RouteConfig;
- You will note the buttons works correctly switching route-a and route-b accordingly.
System Info
System:
OS: Linux 6.17 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
CPU: (4) x64 Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz
Memory: 3.08 GB / 7.68 GB
Container: Yes
Shell: 5.2.21 - /bin/bash
Binaries:
Node: 22.17.1 - /home/malaguenha-lnxon/.nvm/versions/node/v22.17.1/bin/node
npm: 10.9.2 - /home/malaguenha-lnxon/.nvm/versions/node/v22.17.1/bin/npm
pnpm: 10.25.0 - /home/malaguenha-lnxon/.local/share/pnpm/pnpm
Browsers:
Chrome: 144.0.7559.132
Firefox: 147.0.3
Firefox Developer Edition: 147.0.3
npmPackages:
@react-router/dev: 7.12.0 => 7.12.0
@react-router/fs-routes: 7.12.0 => 7.12.0
@react-router/serve: 7.12.0 => 7.12.0
react-router: 7.12.0 => 7.12.0
vite: 7.1.6 => 7.1.6Used Package Manager
pnpm
Expected Behavior
Routing from route-a and route-b should happen without error even having these routes wrapped in sibling layouts.
Actual Behavior
Redirecting (<Link to=...) from route-A to route-B (or vice-versa) throws error. Entering manually the path to the browser's address bar works well, no error.
NOTE: 1. This issue has not been observed in non-RSC setting.
2. This issue happens even when you programatically switch the route by return redirect("/...") from an server component's action.
Reactions are currently unavailable