revalidatePath does not invalidate pages when using optional catch-all routes [[...path]] with dynamic locales.
Reproduction Steps
- Navigate to https://revalidate-issues.vercel.app
- Note the current timestamp on
/frpage - Call the revalidate API:
curl -X POST https://revalidate-issues.vercel.app/api/revalidate -H 'Content-Type: application/json' -d '{"path": "/fr"}'
- Refresh the page
- The timestamp remains unchanged - revalidation did not work
Additional Notes
revalidate = falseis set (dynamic rendering)dynamic = 'error'forces dynamic rendering- Only “en” is in
generateStaticParams; “fr” is intentionally omitted - The issue affects only locales not listed in
generateStaticParams - The issue does not affect subpages like
/fr/about-us - The issue is only in Vercel environment; on local machine it works as expected
Expected Behavior
Calling revalidatePath('/fr') should invalidate the cache for that path, causing a fresh render on next visit.
Observed Behavior
The timestamp does not change after calling revalidatePath, indicating the page is served from cache.
Code: https://github.com/gregorjan/revalidate-issues
Deployed App: https://revalidate-issues.vercel.app