Error: Invariant: static generation store missing in revalidateTag
I’ve used revalidatePath(path); in an app router project in a 'use client', a component without a header, and 'use server'. Everytime I get
Error: Invariant: static generation store missing in revalidateTag_[hash-here]
Using next 14.0.1
create file called actions.ts to the /app/actions.ts ....put this example :
"use server";
import { revalidateTag } from "next/cache";
export default async function action() {
revalidateTag("profile");
}
now just call the action and enjoy...
RevalidateTag should be used in the server layer, and also it usually used when you have performed an action in the server, which might be in a server action, which is a great way of hiding data. I'd recommend to revalidateTag after you have confirmed success in the server action where you performed the PUT/POST
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With