Start: route masks with unmaskOnReload lose the real route on hard reload
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.1k
- Forks
- 1.9k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 143
Description
Which project does this relate to?
Start
Describe the bug
When a route mask uses unmaskOnReload: true, client navigation works, but a hard reload in TanStack Start SSR keeps the browser on the masked URL.
In the repro, the real route is still present in window.history.state.__tempLocation, but the server renders /. Hydration then lands on / instead of /modal, so the modal route disappears.
Your Example Website or App
https://github.com/tmm/tanstack-mask-reload-repro
Steps to Reproduce the Bug or Issue
- Open
/ - Click
Open masked modal - Confirm the modal opens while the URL still shows
/ - Hard reload the page
Expected behavior
After reload, the router should restore /modal before hydration and keep the modal rendered.
Screenshots or Videos
No response.
Platform
- 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
Additional context
Client navigation behaves correctly. This seems specific to SSR reloads with unmaskOnReload: true.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked tanstack-mask-reload-repro and reproduce the hard reload after opening the masked modal. Inspect how the real route in window.history.state.__tempLocation is handled during SSR and hydration; done means reloading restores /modal and keeps the modal rendered instead of rendering /.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript, vite
- Domain
- full-stack
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100