Error fetching content "The provided ref is no longer accessible"

Hi, I'm having this error while fetching documents using a permanent access token, If I generate a new token the fetch works fine

response: {
    type: 'api_validation_error',
    message: 'The provided ref is no longer accessible, it has expired. Master ref is: ZQsdphAAACEA2FjG'
  }
1 Like

Thanks for sharing your use case @alain00.alvarez.

Indeed, each time you get this type of error, you should use a valid and up-to-date ref when fetching documents using a permanent access token.

Hi,

I am having this exact issue, what exactly is causing this to occur? It actually took me a while to figure out what token was incorrect. Building my site locally works fine, but as soon as it is deployed to Vercel I get the error message?

Thanks

Hey everyone,

We're looking into some issues around caching in Next.js. @alain00.alvarez and @jon1 are you both using the App Router?

Sam

In the meantime, you can see if there's any helpful information here:

Hi @samlittlefair, I am using the app router yes. Thanks for the link to this topic!

Hey, I am also having this issue with Nuxt and Vue when deploying on netlify. Is there any update to this issue?

I feel like I was getting this issue among other strange cache issues. Adding the following to my package.json build script helped with Vercel build issues. Locally, I just nuked the .next folder entirely and ran a build and no issues:

"build": "rm -rf .next/cache/fetch-cache && next build"

Anyone else want to test this?

1 Like

@ngiusti If you're having this issue on Nuxt and Vue, it might be a separate error. Could you open a new thread and post your error message?

Hey everyone,

We have opened a thread on the Next.js GitHub repository. Feel free to upvote and subscribe to follow along:

Sam