Gatsby: Broken css after build

Created on 29 Mar 2018  路  5Comments  路  Source: gatsbyjs/gatsby

Hi there!

Can't find a css for static pages, after gatsby build.
This behavior I see only if I reload all existing pages in a browser, but if I'm roaming through site links -
css is working.
Also, css works in the dev mode

There are no errors in console, no errors while building, just as the result - broken css and from time to time they looks different.

Environment

  • gatsby-cli version:1.9.243
  • Node.js version: 8.9.4
  • Operating System: MacOS 10.13.2

File contents :

gatsby-config.js:

+ `gatsby-plugin-jss`,

Would be thankful if you can help me!

Most helpful comment

@KyleAMathews Don't you think it would be a good idea mentioning this somewhere in the documentation? Because devs usually just check how good everything works using gatsby develop and then gatsby build seems to break everything just like that.

All 5 comments

I believe you have the same error as I encountered in #4183
Do check out the issue and take the required steps in adding the styling in html.js for production

@KyleAMathews Don't you think it would be a good idea mentioning this somewhere in the documentation? Because devs usually just check how good everything works using gatsby develop and then gatsby build seems to break everything just like that.

If you use the default html.js (which we strongly encourage you to) then this happens by default.

@ponchique Is your issue resolved?

Yes, I resolved it by rewriting all css using sass. I thought the problem was in jss.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hobochild picture hobochild  路  3Comments

theduke picture theduke  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

andykais picture andykais  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments