Flash of unstyled content (FOUC) issue
I've been trying to fix this FOUC unsuccesfully.
Vite config:
__root.tsx
tanstack react router/start are all version ^1.132.37
I also followed this github issue and can't find any solutions unfortunately.
https://github.com/TanStack/router/issues/3023
GitHub
How to use CSS Modules with TanStack Start? · Issue #3023 · TanSt...
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 unstyle...
9 Replies
correct-apricotOP•2mo ago
app.css:
correct-apricotOP•2mo ago
I noticed the initial html will reference the invalid stylesheet
<link rel="stylesheet" href="/assets/app-D_qkI4jN.css"/>
so thats the first invalid request 404

fascinating-indigo•2mo ago
why do you still have a js tailwind config
correct-apricotOP•2mo ago
eh? it seems i misread the heroui docs. let me fix that
fascinating-indigo•2mo ago
@butts fyi tailwind v4 has no js config anymore, it's all css magic (see @import "tailwindcss")
also heroui's doc is outdated in some aspects
for example
while the
framer-motion package still exists, what you should install motion instead
framer-motion is an alias for now, but you can never know when this alias will be deletedcorrect-apricotOP•2mo ago
@notKamui thanks. I've since removed the tailwind.config.mjs
app.css looks like
Still, the issue persists
this part
equal-aqua•2mo ago
most likely the css is not available during ssr. check the network tab for 404
equal-aqua•2mo ago
https://github.com/TanStack/router/issues/4959
@import 'tailwindcss' source('../'); resolved it for me
GitHub
Tanstack Start: Asset hash mismatch between client and server-side ...
Which project does this relate to? Start Describe the bug This is a follow up issue from this discussion here: #4952 As described in the title, there is an incorrect CSS asset hash value in the ser...
correct-apricotOP•2mo ago
mate you're a lifesaver! thank you very much 🙂