Next 16 App Router navigation hangs after _rsc completes, only with cacheComponents #94550
Replies: 2 comments 1 reply
-
|
Based on your debugging, I would focus on Cache Components / PPR interactions first. A few things I would test:
The fact that If you can provide a minimal reproduction, it would be much easier to determine whether this is an application-level issue or a framework bug. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hi everyone. I’m debugging a strange production-only navigation issue after upgrading a Next.js App Router ecommerce project from Next 15 to Next 16.
Stack:
The same app worked fine on Next 15.
After upgrading to Next 16, some navigations randomly get stuck in production. The top loader goes almost to the end and stays there. Sometimes the route commits after 30 seconds, sometimes after 1-3 minutes, and sometimes it never commits until I click the link again.
Important detail: the network is not slow.
Example from my navigation debugger:
I also checked the Network tab. _rsc finishes quickly and /_next/static JS/CSS chunks are not pending. So it does not look like DB latency, server latency, proxy latency, or slow chunk loading.
The affected route was showing as Partial Prerendered in the production build:
◐ /[locale]/categories/[...categorySlug]When I temporarily disabled cacheComponents: true and commented out "use cache", cacheTag, and cacheLife, the build
changed the routes to dynamic:
ƒ /[locale]/categories/[...categorySlug]After that, navigation worked normally again.
I also tried changing experimental.staleTimes, but Next warned about minimum values, and it did not solve the issue.
So my current conclusion is that this is related to Next 16 Cache Components / PPR / client router segment cache behavior. It feels like the RSC response is ready, but the App Router does not commit the transition for a long time.
Questions:
Has anyone else seen App Router navigation hang after upgrading from Next 15 to Next 16?
Is there a known issue with cacheComponents, PPR, or the client router segment cache delaying route commits?
Are there better debugging tools for seeing what the App Router is waiting on after _rsc has already completed?
Any advice would be appreciated. This has been very hard to trace because the server response is fast, but the client route commit is delayed or stuck.
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions