Does revalidatePath working in 13.5?
Answered
nrsimha posted this in #help-forum
nrsimhaOP
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?
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?
11 Replies
@nrsimha 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?
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
works well for me. can you show me which URL ure trying to revalidate and the route in build logs
@alfonsus ardani works well for me. can you show me which URL ure trying to revalidate and the route in build logs
nrsimhaOP
I try to revalidate for example /en/library/noi
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
nrsimhaOP
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
nrsimhaOP
I am testing in local, where it doesn't work. But not sure what would change if I will deploy it to the server.
nrsimhaOP
Solved, needed to include trailing slash in path
Answer