-
Link to the code that reproduces this issuehttps://github.com/Robstei/next-suspense-needs-timeout To Reproduce
await new Promise((r) => setTimeout(r, 10)); Page3 is slow and does not show the Suspense fallback Current vs. Expected behaviorI would expect Page3 to behave like Page1.
Currently it does only work when i use await new Promise((r) => setTimeout(r, 10)); as shown on Page3 Provide environment informationOperating System:
Platform: linux
Arch: x64
Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024
Available memory (MB): 7790
Available CPU cores: 12
Binaries:
Node: 22.11.0
npm: 10.9.0
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 15.1.7 // Latest available version is detected (15.1.7).
eslint-config-next: 15.1.7
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.3
Next.js Config:
output: N/A Which area(s) are affected? (Select all that apply)Not sure Which stage(s) are affected? (Select all that apply)next start (local) Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I was able to get Page3 working correctly by making the following changes: 1️⃣ Forced the page to be dynamic by adding this at the top of Page3.tsx: 2️⃣ Added a small delay in the promise to ensure ArrayDisplay suspends properly: const arrayPromise = new Promise<number[]>((resolve) => { |
Beta Was this translation helpful? Give feedback.
-
Hi @SharanKarchella. I think export const dynamic = "force-dynamic"; is not needed. You just recreated Page3 where I am using a Timeout already or am I wrong? |
Beta Was this translation helpful? Give feedback.
-
To clarify, every page in App Router uses RSC. The important thing is whether these pages will be prerendered at build time or not. Running the build confirms that every page will be prerendered, similar to when you have a
So during What's curious is that in using On the latest canary, the new dev overlay lets you know whether a page will be prerendered statically, or if it's a dynamic page (Page 1 is dynamic in The move towards dynamicIO I think makes this behavior a lot more simplified than what we currently have with Route Segment Config. |
Beta Was this translation helpful? Give feedback.
To clarify, every page in App Router uses RSC.
The important thing is whether these pages will be prerendered at build time or not. Running the build confirms that every page will be prerendered, similar to when you have a
fetch()
→ https://nextjs.org/docs/app/building-your-application/data-fetching/fetching#fetching-data-on-the-server-with-the-fetch-api.