Reputation: 158
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
.cache
and public
folder and gatsby build
, "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
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