gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.21k stars 10.33k forks source link

gatsby build with gatsby-image shows first image only (blurred, svg, bkg color) not full resolution #3032

Closed migs540 closed 6 years ago

migs540 commented 6 years ago

When doing a gatsby build the resultant index.html files in the public directory only show blurred, svg or background colors - the full resolution image never appears).

This happened on a website I am developing so I git cloned the original gatsby examples and ran that locally (gastby develop) successfully (images blur up to full resolution). But when i run a gatsby build in the /gatsby/examples/using-gatsby-image directory I only get blurred, svg or background colors. This happens for the example (using-gatsby-image) and any other builds i make from scratch. So I am wondering if it is the cli somehow? I am running gatsby -v 1.1.10

Any ideas welcomed because it's a really awesome feature I'd like to implement.

migs540 commented 6 years ago

This was happening because I gzip *.js files on the website. That stops them running. gunzipping files has resolved this but I wonder if it's possible to compress files to improve load speeds? Ideally i can gzip files and continue to execute js?

yachaka commented 6 years ago

@migs540 that should definitely not prevent them from running, the problem comes from either a bad gzip or an other place

KyleAMathews commented 6 years ago

Most servers GZIP files automatically for you. If you're GZIPing files yourself, you need to setup your server to handle that which is probably the problem.

In any case, this isn't a Gatsby bug so closing.

migs540 commented 6 years ago

@yachaka OK thanks, I can troubleshoot gzipping files and if that's not successful I can open a new issue for that as the title of this one will be misleading.

KyleAMathews commented 6 years ago

@migs540 issues for your hosting environment are best posted elsewhere e.g. stackoverflow so we can focus on Gatsby-specific issues here.

migs540 commented 6 years ago

@KyleAMathews yeah totally - i was just about to close this one and you beat me to it. Same problem exists when running gatsby serve locally but I'll keep troubleshooting and open a new issue in the right place with the right title.