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
metropolitan-bronzeOP•2d ago
app.css:
metropolitan-bronzeOP•2d 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

optimistic-gold•2d ago
why do you still have a js tailwind config
metropolitan-bronzeOP•2d ago
eh? it seems i misread the heroui docs. let me fix that
optimistic-gold•2d 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 deletedmetropolitan-bronzeOP•2d ago
@notKamui thanks. I've since removed the tailwind.config.mjs
app.css looks like
Still, the issue persists
this part
conscious-sapphire•23h ago
most likely the css is not available during ssr. check the network tab for 404
conscious-sapphire•23h 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...
metropolitan-bronzeOP•22h ago
mate you're a lifesaver! thank you very much 🙂