Razzle: Styles not rendered on the server

Created on 5 Jul 2017  ·  3Comments  ·  Source: jaredpalmer/razzle

I'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.

Most helpful comment

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

All 3 comments

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

I am using styled components(CSSinJS) for my styling and am facing this problem in production too.

@corydeppen Hello. Have you solved this problem?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dizzyn picture dizzyn  ·  3Comments

alexjoyner picture alexjoyner  ·  3Comments

krazyjakee picture krazyjakee  ·  3Comments

mhuggins picture mhuggins  ·  3Comments

howardya picture howardya  ·  5Comments