You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, there I wanted to share a reproduction of an issue that caused me several hours of debugging in the last days to locate. (I found it finally) π΅βπ«
Updating dependencies & to Next.js 15 (incl. async params, etc.). Don't know if this is v15-specific, just wanted to have the same environment as on in my project where the issue occured. Btw feel free to use this commit to upgrade the example for everyone.
Adding an /api/revalidate route that basically only calls revalidatePath('/[locale]', 'page') (same issue with revalidatePath('/de'))
You have a dynamic segment like [locale] that uses generateStaticParams to be built statically
You invalidate the segment later using revalidatePath
Due to dynamicParams = false, the segment doesn't rebuild on the next visit
In your case, the returned 404 from dynamicParams = false will in turn call the redirect, but I guess that's secondary.
So is the bug really that revalidatePath doesn't schedule a recreation of the affected pages? Maybe you want to report that upstream in the Next.js repo, I think next-intl can't do much about it. Have you checked if there are already bug reports about this?
Btw feel free to use this commit to upgrade the example for everyone.
That's kind of you, thanks! I'm currently waiting with upgrading to Next.js 15 due to #1442.
I'll close this issue since it seems to be an issue in Next.js, hope that sounds right to you!
Description
Hey, there I wanted to share a reproduction of an issue that caused me several hours of debugging in the last days to locate. (I found it finally) π΅βπ«
These are the changes I made from
next-intl/examples/example-app-router
/examples:/api/revalidate
route that basically only callsrevalidatePath('/[locale]', 'page')
(same issue withrevalidatePath('/de')
)export const dynamicParams = false
in[locale]/layout.tsx
(as all locales are statically known upfront)return redirect('/')
in the globalnot-found.tsx
file (as that's the desired behavior for my app)I now removed
dynamicParams = false
in my project. If it's generally advised against having it, I would suggest adding this to the docs!Verifications
Mandatory reproduction URL
https://github.com/wottpal/next-intl-revalidation-bug-repro
Reproduction description
bun install bun run build NEXT_PRIVATE_DEBUG_CACHE=1 bun run start # In a different terminal curl -X POST http://localhost:3000/api/revalidate
Now open http://localhost:3000/de and you'll see an indefinite redirect occur.
Expected behaviour
Just loading the page as normal with an invalidated cache.
The text was updated successfully, but these errors were encountered: