Gatsby | Strapi | Build error: converting image

A couple of weeks or so ago my site started running into errors when deploying. Up until then everything was working okay.

I’ve created a minimal reproduction, which has failed to deploy. According to the deploy log of this repro, the issue seems to be to do with the gatsby-source-strapi package; specifically with it converting images:

error converting image Processing /opt/build/repo/.cache/caches/gatsby-source-strapi/71907e5deaa35e112b9dbdd93774fef6/untitled12 copy.png.png

It seems like ‘.png’ has been repeated (in the conversion by gatsby-source-strapi), which may be the source of the problem. On my main site, deploys starting failing seemingly without this naming bug (see deploy log below). Both sites failing’ deploy logs contain the message:

unable to open for read/write unix error: No such file or directory

It seems as if this naming bug is present on every image in local builds. Despite this, they are successful using gatsby develop and gatsby build.

npm packages
gatsby: ^3.4.1 => 3.4.1
gatsby-plugin-eslint: ^3.0.0 => 3.0.0
gatsby-plugin-image: ^1.5.0 => 1.5.0
gatsby-plugin-sharp: ^3.5.0 => 3.5.0
gatsby-source-filesystem: ^3.5.0 => 3.5.0
gatsby-source-strapi: ^1.0.0-alpha.0 => 1.0.0-alpha.0
gatsby-transformer-sharp: ^3.5.0 => 3.5.0

Minimal reproduction
Github: https://github.com/ruben00001/amyrodriguez_frontend_v.3
Netlify site name: vigorous-beaver-e5ba74 (hasn’t successfully deployed yet)

Deploy logs
Reproduction: Netlify App
Original, main site: Netlify App

Update:

removing the AVIF format option for gatsby-transformer-sharp seems to have resolved this issue and the site is now building. It seems like the issue wasn’t to do with the naming bug above but that only the avif file type was created and then gatsby-source-filesystem would try to look for the .png file type and not find it. I’m not sure whether the error lies in Netlify, gatsby-source-strapi, gatsby-transformer-sharp or elsewhere.

This isn’t a solution because I’d like to be able to have avif image files!

Also, apologies but my minimal reproduction became a new rebuild as I thought I needed it here. I’ll create another if need be.

hi Lato, thanks for sharing your progress. I do know that AVIF images can cause problems, and i will try and bring this up to our gatsby specialists next week.

1 Like

hi @_Lato_X - i talked to our Gatsby pro today, and at the moment, there isn’t an AVIF solution that we can offer! Hopefully, as work progresses, this will become available in the future. His suggested workaround, which i know is maybe not in line with your use case, is to fall back on using something like cloudinary for asset management. Sorry I don’t have better news at this time!

1 Like