Skip to content

FOUC with history.replaceState introduced in @tanstack/solid-router@1.168.1 #6997

@vladmiller

Description

@vladmiller

Which project does this relate to?

Router

Describe the bug

I'm using history.replaceState({}) to update state in URL each time I navigate the gallery. I want to preserve the ID of the currently visible slide, so I can show the same slide on page refresh.

With the latest release router release it introduced FOUC for history.replaceState(...). In Chrome (Chromium) and also confirmed in Arc and Chrome on MacOS. In the logs I'm seeing app reloading .css files every time when history.replaceState is executed.

It also only happens with the built application, not in dev mode.

Your Example Website or App

https://github.com/vladmiller/tanstack-solid-router-fouc-reproduction

Steps to Reproduce the Bug or Issue

  1. pnpm build && pnpm serve
  2. Navigate to serve URL in Chromium based browser
  3. Click on the button to see an effect
    4

Expected behavior

Well, it should not reload css styles.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.168.1
  • OS: Linux
  • Browser: Chromium
  • Browser Version: 146.0.7680.80
  • Bundler: vite
  • Bundler Version: 8.01

Additional context

The previous versions did not have this bug, you can see it with these dev dependencies.

  "dependencies": {
    "@tanstack/solid-router": "1.167.5",
    "@tanstack/solid-start": "1.166.18",
    "solid-js": "^1.9.11"
  },
  "devDependencies": {
    "@tanstack/router-plugin": "1.167.1",
    "typescript": "^5.9.3",
    "vite": "^8.0.1",
    "vite-plugin-solid": "^2.11.11"
  }

Metadata

Metadata

Assignees

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