vercel / next.js

The React Framework
https://nextjs.org
MIT License
122.59k stars 26.23k forks source link

Suspense does not work on page navigation (Next.js 15 Canary, App Router) #67177

Open vitalikda opened 4 days ago

vitalikda commented 4 days ago

Link to the code that reproduces this issue

https://github.com/vitalikda/nextjs15-suspense-bug

To Reproduce

  1. Add Suspense in a wrapping layout
  2. Navigate between async pages

Current vs. Expected behavior

Current: fallback is shown only on the initial page load, then it never shows up again

Expected: fallback is shown on initial page load and consecutive page navigations

DEMO

  1. Initial load
  2. Navigate to Page 1
  3. Navigate to Home

https://github.com/vercel/next.js/assets/9862028/b7e19c74-7551-4338-ac67-a49e86f01bf7

Provide environment information

Relevant Packages:
  next: 15.0.0-canary.43 // Latest available version is detected (15.0.0-canary.43).
  react: 19.0.0-rc-c21bcd627b-20240624
  react-dom: 19.0.0-rc-c21bcd627b-20240624

Which area(s) are affected? (Select all that apply)

Navigation

Which stage(s) are affected? (Select all that apply)

next dev (local), next start (local)

Additional context