SSR flickering in Vite Dev mode #1404
Labels
bug report 🦗
Issue is probably a bug, but it needs to be checked
needs: complete repro 🖥️
Issue need to have complete repro provided
platform: ssr 🛠️
Issue related to SSR
Description
In Vite Dev mode for react server-side rendered application the critical CSS needed for styling the application only loads after a while after the vite runtime is loaded and the application is finished hydration.
This results in very bad flickering of UI in big applications since time to load the Vite runtime and hydration can take few seconds.
This is only an issue in dev mode of the plugin, in production mode it works perfectly where it extracts the css to a file and is inlined in the out html.
Reproducible Demo
https://github.com/chin2km/linaria-vite-dev-ssr-issue
goes to the below state after some time
Environment
Node: 20
Bundler: Vite 5
Linaria Version: 6.1.0
OS: macOS
Expectation
The linaria styles are extracted to css file and is either:
The text was updated successfully, but these errors were encountered: