Error: Invariant: static generation store missing in revalidateTag

4.3k Views Asked by At

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

1

There are 1 best solutions below

1
On

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...