Skip to content

CSS module gets unloaded on navigation, while still needed #6028

@Dubzer

Description

@Dubzer

Which project does this relate to?

Start

Describe the bug

hii
i've found a bug, where if two pages depend on a common CSS module, it gets unloaded when navigating from the first to the second page, thus breaking the styles. i enabled ssr: false on both pages and the bug still persists, so the problem might lie within the router rather than the start

Your Example Website or App

https://github.com/Dubzer/tanstack-start-css-unloads-repro

Steps to Reproduce the Bug or Issue

  1. pnpm build
  2. cd ./dist && pnpx srvx --prod --static ../client ./server/server.js
  3. open /
  4. click to subpath in navbar
  5. notice that the button has lost its styles

Expected behavior

the stylesheet doesn't get unloaded

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.139.14
  • OS: macOS
  • Browser: Chromium
  • Browser Version: 143.0.7499.40
  • Bundler: vite
  • Bundler Version: 7.1.7

Additional context

doesn't seem to be a recent regression

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