T
TanStack2d ago
stormy-gold

Is FOUC expected to occur any time SSR is not true?

Just wondering if this is expected or what can be done to not have the flash of unstyled content occur when ssr is set to either data-only or false Here is a very minimal reproduction with all the latest packages and using (what I assume is the most stable/recommended) nitro v2 plugin. I've also tried the same thing with the nitro v3 beta. Happening in dev mode with Vite and also when running the production server from .output Forgot the repo! Here it is: https://github.com/imattdunbar/tss-no-ssr-fouc
5 Replies
adverse-sapphire
adverse-sapphire2d ago
what do you mean by "flash unstyled" ? i only see a white flashing, but the text is not unstyled
stormy-gold
stormy-goldOP2d ago
Well I guess just the flash of white in general, that's not typically supposed to happen right?
adverse-sapphire
adverse-sapphire2d ago
this is caused by the shell component being "plain white" thats the thing you get back from the server as HTML only then, when the client hydrates, the black background is rendered so if you make your shell component black as well, it will not flash
stormy-gold
stormy-goldOP2d ago
Ahhhh ok that makes sense, now I feel silly lol thank you for responding, I'm used to building with SPAs only so trying to make the mental jump to all the SSR concepts!
adverse-sapphire
adverse-sapphire2d ago
no worries

Did you find this page helpful?