Next.js Discord

Discord Forum

Does revalidatePath working in 13.5?

Answered
nrsimha posted this in #help-forum
Open in Discord
I tried revalidatePath with literal route segment (for example, /product/123) through api/revalidate as in docs example. But although it returns valid json showing page was revalidated nothing actually happens. Page doesn't seem to be revalidated.

I can still see files in .next/server/app/PATH/TO/FILE and after revisiting 'revalidated' url it still shows old version and all files have old timestamp.

So it seems revalidatePath function doesn't do anything.

Is revalidatePath working for any of you?
Answered by nrsimha
Solved, needed to include trailing slash in path
View full answer

11 Replies

works well for me. can you show me which URL ure trying to revalidate and the route in build logs
Where can I find build logs?
Is that whatever shows in terminal during build?
@nrsimha Where can I find build logs?
When you do npm run build or next build
The summary of the routes are most important of how your sites will behave
I don't build all routes during npm run build, but revalidate doesn't work me for either for routes which are build during building process and also for routes which are saved on first load
If it is working for you, are you using same code as in documentation?
@Common Poorwill I just updated to 13.5 and revalidatePath() seems to be working, although works only in my prod environment, not in local, just as it did before the update. So much to learn here
I am testing in local, where it doesn't work. But not sure what would change if I will deploy it to the server.
Solved, needed to include trailing slash in path
Answer