Minimal reproduction, made from npx create-next-app -e reproduction-template.
app/page.tsxlinks to/slow.app/slow/loading.tsxrendersLoading….app/slow/layout.tsxwaits 3 s. The prefetch of the loading state renders this layout, so the prefetch takes 3 s. That leaves time to click while it is in flight.app/slow/page.tsxwaits 6 s.
The dev server does not prefetch loading states, so use a production build.
pnpm install
pnpm build
pnpm start- Open http://localhost:3000.
- Click "Go to /slow" within 3 seconds of the page loading.
About 3 s after the page loads, the URL changes to /slow and the page is empty. Loading… never shows. "Slow page" appears about 3 s later.
To compare, reload and wait 4 seconds before clicking. Loading… shows right after the click, as expected.