question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build error: Graphql "Input file contains unsupported image format"

See original GitHub issue

Description

Some types of images cause Gatsby to throw an error during build. There’s no error message or context that shows which specific image is causing the problem.

While I’m pretty sure the actual error lies in a dependency of Gatsby, may aim with this bug report is to find out how to figure out which image is causing the problem. That, I believe, Gatsby could tell me.

I have a site with ~2k images, and some of them throw this error. It’s quite laborious to try to figure out which ones by trial an error!

Steps to reproduce

This is a 2 repo project. I’ve setup both repos with branches that show a minimum reproduction of this problem.

Here’s the URLs to the 4 images in the reproduction, any one of which will generate this error:

Expected result

Should build!

Actual result

 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Input file contains unsupported image format

Environment

Gatsby environment
  npmPackages:
    gatsby: ^2.24.56 => 2.24.56 
    gatsby-image: ^2.4.17 => 2.4.17 
    gatsby-plugin-manifest: ^2.4.28 => 2.4.28 
    gatsby-plugin-material-ui: ^2.1.10 => 2.1.10 
    gatsby-plugin-offline: ^3.2.27 => 3.2.27 
    gatsby-plugin-react-helmet: ^3.3.10 => 3.3.10 
    gatsby-plugin-sharp: ^2.6.34 => 2.6.34 
    gatsby-plugin-typescript: ^2.4.19 => 2.4.19 
    gatsby-source-filesystem: ^2.3.29 => 2.3.29 
    gatsby-transformer-json: ^2.4.11 => 2.4.11 
    gatsby-transformer-sharp: ^2.5.14 => 2.5.14 
  npmGlobalPackages:
    gatsby-cli: 1.1.46
    gatsby-dev-cli: 1.2.12
    gatsby: 2.0.18

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
KyleAMathewscommented, Dec 17, 2020

Also could you try installing the latest version of gatsby-plugin-sharp (if you haven’t already) to make sure you’re getting fixes we have rolled out for these error messages?

0reactions
AleksandrHovhannisyancommented, Dec 17, 2020

In my case, it turned out to be me using .gitattributes with LF for everything, including images. This resulted in corrupted image files. Oops 😄 Hope that helps someone out there (it probably won’t).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Input file contains unsupported image format - Gatsby
One more thing is that this error is thrown on the different model (not always on the same model). We were using flamelink...
Read more >
GitHub Actions fail with Gatsby Error: Input file contains ...
The issue seems to be related to the favicon path, ensure that the path is correct and try changing it to other dummy...
Read more >
Error "gatsby-plugin-manifest" Input file contains unsupported ...
I'm getting an unsupported image error when trying to deploy my Gatsby site to Netlify. The error is from the gatsby-plugin-manifest, see screenshot...
Read more >
Input file contains unsupported image format might be a race ...
Nodejs sharp error - Input file contains unsupported image format might be a race condition ... Was doing some S3 work where I...
Read more >
Sharp Image Metadata Extraction Error Input File Contains ...
Amazon Rekognition Image currently supports the JPEG and PNG image formats. You can submit images either as an S3 object or as a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found