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?
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"
On occasion I see some “stranger things” related to refs. I just delete my .next folder locally and the issue goes away. Fortunately, I haven’t seen this issue in production in a while though.
Good afternoon, my Teach Lead and I managed to solve this problem in nextjs 14.2 using react's "cache" function. For now it is working well in our projects.
import { createClient } from '@prismicio/client'
import sm from '../../slicemachine.config.json'
export const client = createClient(
`https://${sm.repositoryName}.cdn.prismic.io/api/v2`,
)
export const getTimeline = cache(async () => {
return await client.getSingle('timeline')
})
Thank you for sharing your solution Nicole Although I'm curious as to what happens when you update the 'timeline' type? Can you test this and see if it works correctly?
good morning! I went back to work on the project and got the "Unhandled Runtime Error Error: No documents were returned" error again, I deleted the .next cache folder and it corrected my error, I believe it is due to cache and conflict with other projects, informing which worked normally even without the react cache function after deleting the folder