Nowadays we are getting below error frequently while building the gatsby project where we used datocms as headless cms. We are using the plugin gatsby-source-datocms. Note that gatsby build works sometimes perfectly. This error is random, but it is happening frequently. One more thing is that this error is thrown on the different model (not always on the same model). We were using flamelink as headless cms before datocms. We had image download problem frequently, so build use to fail. That is the reason we have move from flamelink to datocms. But we ended up into same situation. This is very critical project for us. Please help us.
There was an error in your GraphQL query:
Input file contains unsupported image format
1 | fragment GatsbyDatoCmsFluid_tracedSVG on DatoCmsFluid {
> 2 | tracedSVG
| ^
3 | aspectRatio
4 | src
5 | srcSet
6 | sizes
7 | }
8 |
9 | query DatoCmsGuide($pillarId: String!) {
10 | pillar: datoCmsGuide(id: {eq: $pillarId}) {
11 | id
12 | name
Error: Input file contains unsupported image format
Iām testing a website with thousands of images and the tracedSVG query is working fineā¦ the error implies that gatsby-plugin-sharp cannot recognize a specific file as imageā¦ maybe also try to upgrade this dependency to the latest version available!
We are not getting this error always. Build works sometimes and it does not work sometimes. Anyway as you suggested we will upgrade gatsby-plugin-sharp and check. we will update back the status here after upgrading.
I set the property failOnError:false for the plugin gatsby-plugin-sharp and tried building. Build is broken, but I am not seeing any additional debug info. See the below error
There was an error in your GraphQL query:
Input file contains unsupported image format
1 | fragment GatsbyDatoCmsFluid_tracedSVG on DatoCmsFluid {
> 2 | tracedSVG
| ^
3 | aspectRatio
4 | src
5 | srcSet
6 | sizes
7 | }
8 |
9 | query userssaranwsgtGwsgreythr4WebsitegatsbysrctemplatesmoduleJs2984280044($slug: String!, $regionRegx: String) {
10 | featuresList: allDatoCmsFeature(filter: {module: {slug: {eq: $slug}}, region: {regex: $regionRegx}}, sort:
{fields: displayOrder}) {
11 | nodes {
12 | title
@saran Iām sorry but with the level of information I have thatās all I can do. Iāve even tried the same query with your DatoCMS project, which I believe is greythr-website, and all SVGs are correctly generated:
As I told you, we can help you if we have access to the projectā¦ otherwise itās impossible to debug. Yesterday we released a new version of the plugin, maybe try that one and see if it solves?
@s.verna we are not able to send zip files through email as our email provider is blocking for security reasons. Is there any other way of securely transferring code to you?
@s.verna as suggested by you I have shared the gitlab code repo. Also sent a mail to support@datocms.com with the details of how to build.
Even today our build failed multiple times. This issue is an intermittent issue. The issue may not happen in the first time itself. But it is very frequent. Out of 10 builds 2 builds are getting succeeded. Issue what we think is that images are not getting downloaded completely, so it is throwing the error mentioned in the community forum.
So try executing the command āgatsby buildā multiple times to reproduce this error.