Next.js Discord

Discord Forum

Revalidate page from clientside?

Yellow-breasted Bunting posted this in #help-forum
Open in Discord
Yellow-breasted BuntingOP
Hi I was trying to use import { revalidatePath } from "next/cache"; in client side component to run after some data mutation but get an error:7
Uncaught (in promise) Error: Invariant: static generation store missing in revalidateTag _N_T_

Im guessing this is meant to be used for server side (it works for me there fine). Should I just useRouter/useNavigation and refresh the page?

1 Reply

Yellow-breasted BuntingOP
Maybe you dont want this sort of power on the clientside