-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
Description
Which project does this relate to?
Start
Describe the bug
I'm struggling to make CSS Modules work properly. Currently, the styles are being loaded only on the client, causing a flash of unstyled content (FOUC) during initial render.
I tried in this repo https://github.com/tanstack/router/tree/main/examples/react/start-basic
Your Example Website or App
https://github.com/nikolayemrikh/start-css-modules-bug
Steps to Reproduce the Bug or Issue
- Clone repo https://github.com/nikolayemrikh/start-css-modules-bug
- Add CSS Modules support by creating a .module.css file and importing it into a React component.
- Run the server and open the app in a browser.
- Observe that the styles are applied only after the client-side hydration, causing a flash of unstyled content (FOUC).
Expected behavior
I would like to see a working example or documentation on how to properly configure TanStack Router with CSS Modules and SSR.
The desired behavior is to have styles included in the server-rendered HTML, so there is no flash of unstyled content (FOUC).
Screenshots or Videos
No response
Platform
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 91.1]
Additional context
No response
Reactions are currently unavailable