Styles not rendered on the server
See original GitHub issueI’ve noticed styles are not rendered on the server and are only rendered once the client app starts, causing a brief flash of unstyled content. When I looked at build/assets.json, the css key was missing after running yarn start, but is present after running yarn build. If it’s intentional to extract the styles only for a production build, I’m trying to understand how the styles can be rendered prior to the client app starting and preventing the FOUC.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Why is my .css file not fully rendering on server, but working ...
Essentially, my style.css file is only partially rendering on the live server, despite working properly in my local development environment.
Read more >CSS styles and images not rendered by server in DEV/PROD ...
Hi, i'v got issue with styles and images not rendered on server side in nextjs typescript app, on client everything works fine.
Read more >How To Render CSS on React App Servers | DigitalOcean
Unfortunately, styled-components are not rendered to the server which makes them unavailable at that time.
Read more >Server rendering - Material UI - MUI
The key step in server-side rendering is to render the initial HTML of the component before we send it to the client-side. To...
Read more >Styling - Remix
When the route is no longer active, the stylesheet is removed. ... render" in order to extract the styles from the component tree...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This only happens during development. There is no FOUC when run in production. If this is problematic, I suggest extending razzle to use extract text webpack plugin to pull out style sheets during dev just as they are pulled in razzle-build. I am not sure that HMR will work the way you expect if you make this change
For anybody else, ran into a similar problem that scss is not loading. Replacing the style-loader with MiniCssExtractPlugin fixed it.