Skip to content

About

Minimal reproduction for TanStack Start masked route reload with unmaskOnReload

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

TanStack Start Masked Route Reload Repro

Minimal reproduction for masked modal routes in TanStack Start SSR.

Versions

  • @tanstack/react-router: latest from scaffold time
  • @tanstack/react-start: latest from scaffold time

Run

pnpm install
pnpm dev

Open http://localhost:3000.

Repro Steps

  1. Open /
  2. Click Open masked modal
  3. Confirm the modal opens while the URL still shows /
  4. Hard reload the page

Configuration Under Test

src/router.tsx defines a route mask:

createRouteMask({
  from: '/modal',
  routeTree,
  to: '/',
  unmaskOnReload: true,
})

Expected

After reload, the URL should un-mask to /modal and the modal route should still be rendered.

Actual

In TanStack Start SSR, the URL stays on / after reload, so the modal route is lost.

Upstream Issue Draft

Title: Start: route masks with unmaskOnReload lose the real route on hard reload

Which project does this relate to?

Start

Describe the bug

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.

Your Example Website or App

https://github.com/tmm/tanstack-mask-reload-repro

Steps to Reproduce the Bug or Issue

  1. Open /
  2. Click Open masked modal
  3. Confirm the modal opens while the URL still shows /
  4. Hard reload the page

Expected behavior

After reload, the router should restore the real route /modal before hydration and keep the modal rendered.

Screenshots or Videos

No response.

Platform

  • Router / Start Version: @tanstack/react-router 1.168.10, @tanstack/react-start 1.167.16
  • OS: macOS
  • Browser: Chrome
  • Browser Version: current stable
  • Bundler: Vite
  • Bundler Version: 7.3.2

Additional context

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,
})

About

Minimal reproduction for TanStack Start masked route reload with unmaskOnReload

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages