Next.js Discord

Discord Forum

revalidatePath doesn't work

Answered
Black carpenter ant posted this in #help-forum
Open in Discord
Black carpenter antOP
Hello I wanna try revalidatePath about-us. I have structure app like on image and i have endpoint:
export async function GET() {
revalidatePath("/about-us");
return Response.json({ revalidated: true, now: Date.now() });
}


When i run /api/revalidate. I got correct feedback but data doesn't change. why
Answered by Black carpenter ant
I solved it. Missing locale path for example : "/en/about-us"
View full answer

13 Replies

Black carpenter antOP
I solved it. Missing locale path for example : "/en/about-us"
Answer
Black carpenter antOP
few hours for thinking whats wrong with it xD
Does it change the data realtime or only the next time you visit the page?
Black carpenter antOP
It change when i refresh
so next visit the page
it is okay
You’re already in the page?
Black carpenter antOP
yes
You can do
redirect(“/about-us”)
I think that can solve it
Black carpenter antOP
the next visit is okay
revalidatePath is enough for it
Ok cool, depending on the use case