[Next.js 13][Routing][Pre-fetching] Dynamic route fails to pre-fetch (404)
See original GitHub issueI have already made a ticket for this, but i’m giving here some details.
Pre-fetching (with <Link>
or router.prefetch()
) dynamic routes like app/test/[testId]/leaf
(with one segment over the dynamic param) throws a 404 Not Found on Vercel (the page exists). It works fine on next dev
and next start
and with other cloud providers.
You can try it here https://test-headers-vercel.vercel.app/test
In the inspector you can see that pre-fetching /test/1
works as expected, pre-fetching /test/1/leaf
throws a 404.
For /test/1
For /test/1/leaf
(The first cache hit is a MISS, Vercel then caches it)
This forces a hard navigation to /test/1/leaf
(probably related to this issue).
I haven’t tried it on Next 12.
BTW: pre-fetching seems to work in dev, contrary to what is written in the beta doc
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:8 (2 by maintainers)
Hi, this should be corrected now, please re-deploy your project and give it a try!
Still falls under our team’s work, we’ll investigate 👍