Minimal reproduction for masked modal routes in TanStack Start SSR.
@tanstack/react-router:latestfrom scaffold time@tanstack/react-start:latestfrom scaffold time
pnpm install
pnpm devOpen http://localhost:3000.
- Open
/ - Click
Open masked modal - Confirm the modal opens while the URL still shows
/ - Hard reload the page
src/router.tsx defines a route mask:
createRouteMask({
from: '/modal',
routeTree,
to: '/',
unmaskOnReload: true,
})After reload, the URL should un-mask to /modal and the modal route should still be rendered.
In TanStack Start SSR, the URL stays on / after reload, so the modal route is lost.
Title: Start: route masks with unmaskOnReload lose the real route on hard reload
Start
When a route mask uses unmaskOnReload: true, opening a masked modal route works during client navigation, but a hard reload keeps the browser on the masked URL in TanStack Start SSR.
In this repro, the real route is still present in window.history.state.__tempLocation, but the server renders the masked URL. Hydration then lands on / instead of /modal, so the modal route is lost.
https://github.com/tmm/tanstack-mask-reload-repro
- Open
/ - Click
Open masked modal - Confirm the modal opens while the URL still shows
/ - Hard reload the page
After reload, the router should restore the real route /modal before hydration and keep the modal rendered.
No response.
- Router / Start Version:
@tanstack/react-router1.168.10,@tanstack/react-start1.167.16 - OS: macOS
- Browser: Chrome
- Browser Version: current stable
- Bundler: Vite
- Bundler Version:
7.3.2
This looks specific to SSR reloads. Client navigation behaves correctly. The repro is intentionally minimal and only uses a single route mask:
createRouteMask({
from: '/modal',
routeTree,
to: '/',
unmaskOnReload: true,
})