1

At first I was getting this error on my local build server, but I managed to fix it there... the query is still the same, but gatsby isn't throwing any errors with the query. But every time I try to deploy on Netlify it fails with the following message:

toFormat seems to be empty, we need a fileExtension to set it.
    1 | fragment GatsbyContentfulFluid_tracedSVG on ContentfulFluid {
 >  2 |   tracedSVG
      |   ^
    3 |   aspectRatio
    4 |   src
    5 |   srcSet
    6 |   sizes
    7 | }
 failed during stage 'building site': Build script returned non-zero exit code: 1
    8 |
    9 | query optbuildreposrccomponentsshopProductsJs2136335468 {
   10 |   products: allContentfulProduct {
   11 |     edges {
   12 |       node {
 Shutting down logging, 22 messages pending
 File path: /opt/build/repo/src/components/shop/Products.js
 Plugin: none

This is the same error I was getting locally and I have no idea why it is occurring. There should be no reason that toFormat is a required parameter. This is using the standard gatsby-source-contentful plugin API request which has always served the image without issue in the past. If I change the request to 'fixed' instead of 'fluid' the problem goes away, but I need fluid images for this part of the site.

I emailed the Netlify staff a few days ago, but am yet to receive a reply. Any help would be greatly appreciated.

2
  • i am facing the same problem....did you get the fix or any update? Commented Apr 23, 2020 at 10:28
  • Hi, umm, the problem kind of went away. I think I changed the queries to static images in the end. I'm sorry that I didn't document the process better. You can have a look at the repository at github.com/erasebegin/otherworld-ink Commented Apr 27, 2020 at 16:03

2 Answers 2

3

For Those who are facing the same issue I came up with a simple solution.

  1. Remove from all your file places that you used this extension _tracedSVG.

eg.

GatsbyContentfulFixed_tracedSVG 

to

GatsbyContentfulFixed
  1. Stop your gatsby server and use the follow command:

    gatsby clean && gatsby develop

  2. Commit and push your changes (in case you are using Github)

  3. On Netlify find the option: Clear cache and deploy site

It should fix your Deployment on Netlify as well errors on your console :)

Sign up to request clarification or add additional context in comments.

Comments

1

Two suggestions:

  1. Local: Double check your content for any image references that do not append a suffix of .png or .jpg
  2. Netlify: Clear cache and deploy site

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.