Code_Like_a_Newbie
Code_Like_a_Newbie

Reputation: 158

Cache Files Not Found with Gatsby Source Contentful in Gatsby V4

Context:

I've migrated my Gatsby project to the latest Gatsby Version 4 and use the new gatsby-plugin-image rather than the deprecated gatsby-image.

When I deployed to Netlify, I kept getting the same error below. However, in local development, everything is working.

Error: ENOENT: no such file or directory, open '/opt/build/repo/.cache/caches/gatsby-source-contentful/xxsdfhsdkfh/myimage.png

What I've tried ( didn't fix the problem sadly)

  1. Click the "Clear cache and deploy site" in Netlify
  2. Deleted the .cache and public folder and gatsby build,
  3. Updated some files and pushed the changes again

Version / Dependencies

    "gatsby": "^4.0.1",
    "gatsby-source-contentful": "6.0.0",
    "gatsby-source-filesystem": "^4.0.0",
    "gatsby-source-graphql": "^4.0.0",
    "gatsby-plugin-netlify": "3.14.0",
    "gatsby-plugin-image": "^2.0.0",

.. more 
    

THANK YOU FOR YOUR HELP!!!

Upvotes: 1

Views: 490

Answers (1)

Ferran Buireu
Ferran Buireu

Reputation: 29320

Keeping in mind the path that is prompting the error (.cache):

Error: ENOENT: no such file or directory, open '/opt/build/repo/.cache/caches/gatsby-source-contentful/xxsdfhsdkfh/myimage.png

I'd try to run a fresh deploy clicking the "Clear cache and deploy site"

Upvotes: 1

Related Questions