Agreed. I resolved the reference errors by adding an access token. However, in reality, this should not be necessary.
I was also having this issue even with access token and next 14.0.4. Specifically I was having this issue with API routes which I'm using to update my search index when documents are published/deleted.
I'm pretty sure it's due to the default createClient function having "force-cache" which resulted in all routes, even API POST routes (which are supposed to avoid caching as far as I understand) having Next.js fetch caching forced.
I resolved this on my project by adding
export const fetchCache = 'force-no-store';
to the top of each API route that I wanted to avoid caching.
I also have export const revalidate = 0;
in my routes, but I'm pretty sure only the fetchCache export is required to fix.
Here are some more relevant options that may be useful for people who still have issues with this as there are a lot of different ways to control caching per route.
Happens to me as well next 14.2.4. Every time I publish a post, it gives me the error below.
Application error: a server-side exception has occurred (see the server logs for more information).
with a digest code.
Is there a solid workaround for this issue?
Edit:
It's working now using this guide
Hi Everyone,
Our recommended setup should work. However, each project's specific code may have different caching/revalidating setups.
The issue is actually around Vercel's cache system, so the best help you might receive here could be through their help centre.
Thanks.
A post was split to a new topic: Webhook to Vercel returning 405