#REVALIDATE
1 messages · Page 1 of 1 (latest)
Hi @golden arrow. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
The error you're encountering, Invariant: static generation store missing in revalidateTag, has been reported by other users in the Next.js community as well. It seems to occur when trying to revalidate data, particularly with dynamic routes or when not using fetch for data fetching.
In one of the Github issues (https://github.com/vercel/next.js/issues/49861), a user reported a similar problem when using revalidatePath but the error was related to revalidateTag. It was suggested that the error might be due to the length of the slug parameter in the path. If the slug parameter exceeds 58 characters, the error might be thrown.
Another Github issue (https://github.com/vercel/next.js/issues/50714) discussed a case where the error occurred because the native fetch function was not passed to the GraphQL client. Once the user added the fetch function, revalidateTag worked as expected.
If you're not using fetch for data fetching, it was suggested in the same issue that you could use unstable_cache to make it work.
In the Vercel documentation (https://vercel.com/docs/incremental-static-regeneration/quickstart), it's shown how to revalidate a page on demand with Next.js by creating an Environment Variable to store a revalidation secret and an API Route that checks for the secret, then triggers revalidation.
If you're still encountering the issue, it might be a good idea to check if there's a bug in Next.js or if there's something wrong with your implementation. You could also consider opening a new issue in the Next.js Github repository with a detailed description of your problem and the steps to reproduce it.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@golden arrow kapa.ai is still learning and improving, please let us know how it did by reacting below
@rigid geyser how do i use unstable cache to ensure my page is updated after update new things
