-
-
Notifications
You must be signed in to change notification settings - Fork 329
Closed
Labels
Description
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:
- 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/revalidateroute that basically only callsrevalidatePath('/[locale]', 'page')(same issue withrevalidatePath('/de')) - Adding the bug reproduction in this commit:
- Add
export const dynamicParams = falsein[locale]/layout.tsx(as all locales are statically known upfront) - Adding a
return redirect('/')in the globalnot-found.tsxfile (as that's the desired behavior for my app)
- Add
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
- I've verified that the problem I'm experiencing isn't covered in the docs.
- I've searched for similar, existing issues on GitHub and Stack Overflow.
- I've compared my app to a working example to look for differences.
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/revalidateNow 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.