Gatsby-source-prismic stopped working

My prismic + gatsby website is suddenly failing to build on local, with the following error:

Plugin gatsby-source-prismic returned an error request to https://mascot.prismic.io/api/v2?access_token= $TOKEN_GOES_HERE failed, reason: getaddrinfo ENOTFOUND mascot.prismic.io

Clicking the link with the access_token included pulls up the content explorer interface as expected.

What's hard to understand is why this stopped working suddenly. I haven't changed the codebase or upgraded any packages or even done a major macOS update (currently on 11.6 Big Sur). Deploys on Netlify are continuing to work as well.

Hi Chris,

Welcome to the Prismic community,
As you might know when you build your project locally. Gatsby tries to fetch your data from Prismic, and there are a few cases where it might fail in case of corrupted Gatsby cache that is using an old Prismic API Ref or some time-outs.

In your case, I would favor the cache scenario, and to solve this, can you try to clean your Gatsby cache such as gatsby clean

Please let us know if that doesn't solve the issue to try to investigate further,
Fares