Gatsby Strapi v4 Cannot query field "localFile" on type "STRAPI__MEDIA"

System Information
  • Strapi Version: 4.1.8
  • Operating System: macOS 13.2
  • Database: Postgres
  • Node Version: 16.13.2
  • NPM Version: 8.1.2
  • Yarn Version: 1.22.17

After uploading my images on my Heroku-deployed Strapi backend, the images are broken and I’m not able to deploy my Gatsby frontend on Vercel. I’m currently getting this error: Cannot query field "localFile" on type "STRAPI__MEDIA" with GraphQL.

Is this due to me using localFile for storing images? Do I need to store my images using a provider like s3 or cloudinary to successfully access my images? i’ve been following the strapi v4 guides and docs and I’ve hit a dead-end with image handling. The images work fine when I’m developing locally, but not on my deployed production backend, which leads me to believe it’s how I’m storing images in the filesystem.

Any help would be greatly appreciated! Thank you!

Try removing the / at the end of the Strapi deployed URL and create a new API token, it worked for me. I also got into the Same situation