Skip to content

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

@tmm

Description

@tmm

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

  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 /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

Client navigation behaves correctly. This seems specific to SSR reloads with unmaskOnReload: true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions