Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Failing to Compile Sporadically on Netlify Builds #4418

Closed
jaredsilver opened this issue Mar 7, 2018 · 8 comments
Closed

CSS Failing to Compile Sporadically on Netlify Builds #4418

jaredsilver opened this issue Mar 7, 2018 · 8 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more. type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@jaredsilver
Copy link
Contributor

Description

I'm not convinced this is an issue with Gatsby, but the Twitter account encouraged me to open an issue for it just in case.

A couple times recently, I've gone to deploy my personal website built with Gatsby on Netlify, and it appears the CSS either fails to compile or fails to load once deployed.

The build logs show no sign of any warnings or errors, but the result is my personal website appearing without any styling.

Steps to reproduce

This happens sporadically, and I've not been able to reproduce it by my own volition. It has not happened locally.

It appears to get fixed when I manually redeploy and clear the build cache on Netlify.

Expected result

The site should appear as it does during local development.

Actual result

The site appears without styling.

Environment

  • Gatsby version (npm list gatsby): 1.9.145
  • gatsby-cli version (gatsby --version): Unsure (whatever Netlify uses)
  • Node.js version: v6.13.1
  • Operating System: Unsure (whatever Netlify uses)

File contents (if changed):

gatsby-config.js: https://github.com/jaredsilver/jaredasilver.com/blob/master/gatsby-config.js
package.json: https://github.com/jaredsilver/jaredasilver.com/blob/master/package.json
gatsby-node.js: not changed
gatsby-browser.js: not changed
gatsby-ssr.js: not changed

@m-allanson
Copy link
Contributor

m-allanson commented Mar 7, 2018 via email

@jaredsilver
Copy link
Contributor Author

jaredsilver commented Mar 7, 2018

I just ran yarn upgrade and deployed, and the issue still occurred unfortunately.

Is it possible I've just made a mess of npm and yarn?

npm list gatsby returns 1.9.145 whereas yarn list gatsby returns 1.9.225. The logs show that yarn.lock is being used for versioning.

@jaredsilver
Copy link
Contributor Author

jaredsilver commented Mar 7, 2018

Just adding some additional information:

Here's a version of the site on Netlify that deployed with no CSS: https://5aa035a2295b5513ea171241--jaredasilver.netlify.com/

And here's the live version with CSS: https://jaredasilver.com

For some reason, the first one has nothing inside <style id='gatsby-inlined-css'></style>, but clearing the build cache and triggering a manual redeploy made it work as expected.

@m-allanson
Copy link
Contributor

Could this be related to #4516?

@zacaytion
Copy link

I'm having the same issue.
However I don't think it's a netlify issue as my styling doesn't appear when I build locally either.
The only style that seems to work locally is my font, which is being handled bytypography.js. What is odd is that the correct font loads for a few milliseconds before it reverts to the system font.

I'm using emotion and react-emotion for my CSS-in-JS solution, so the issue could be stemming from that.

@andrewkslv
Copy link

andrewkslv commented May 21, 2018

Same issue for me. I created a project from gatsby-advanced-starter and added "gatsby-plugin-sass": "^1.0.26". With develop, scss works fine but not with build command.

Still didn't find a cause of the issue.

Mac OS.

@kakadiadarpan
Copy link
Contributor

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub issues, we have to clean some of the old issues as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Gatsby version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@kakadiadarpan kakadiadarpan added type: question or discussion Issue discussing or asking a question about Gatsby stale? Issue that may be closed soon due to the original author not responding any more. labels Sep 25, 2018
@jaredsilver
Copy link
Contributor Author

I haven't experienced this problem in months, so I'm going to close the issue. If it comes up again, or if someone else experiences something similar, we can reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

5 participants