Open mwildehahn opened 12 months ago
Have you had any success with figuring out why the loading state is not instant like mentioned in the docs?
Similar issue in the Next Dashboard App course:
The Invoices
page is never prefetched, not even its <Suspense>
fallbacks. The content of the prefetch is
0:["7EGV6vg9n8TEdf9zJaqPA",[["children","dashboard","children","invoices",["invoices",{"children":["__PAGE__",{}]}],null,null]]]
Link to the code that reproduces this issue or a replay of the bug
https://github.com/mwildehahn/reproduce-layout-rerender
To Reproduce
Current vs. Expected behavior
I might be misunderstanding this, but from https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating
I took this to mean that the loading.js file for the route would be prefetched and cached (which makes sense). In practice, it seems like a prefetch does happen, but it doesn't include the loading file and I can't see that file cached when inspecting
window.nd.prefetchCache
after the prefetch has returned.What I would expect is to instantly see a transition to the loading state and then maybe an error state after that if the navigation fails but now it seems like it requires making the initial server request to display the loading state.
It seems like something is broken with caching in general since even if you don't mess with network conditions, the previous route is never cached even within the 30s window
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
App Router, Routing (next/router, next/navigation, next/link)
Additional context
No response