Open pkellner opened 1 month ago
I wonder if this is because the SSR pass is using the non-streaming
Server Side APIs, renderToNodeStream
for example, which are at the core of Page Router.
We can see that, if we defer to client side only rendering, then the Suspense boundary does get triggered.
In the docs for, renderToNodeStream, we find:
This method will wait for all Suspense boundaries to complete before returning any output.
It'd seem like, this what happens in your repository.
Link to the code that reproduces this issue
https://github.com/pkellner/nextjs-15-rc-suspense-page-router-issue
To Reproduce
run
next dev
and browse to localhost:3000. This runs /pages/index.js and you should see a loading message that should have been generated from the Suspense fallback. The exact same code (but with 'use client' at the top) is working in the /app/test/page.js (localhost:3000/test)Current vs. Expected behavior
Expect localhost:3000 to show loading message for 2 seconds before rendering list and it does not.
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I plan on upgrading old projects that use the page router to use client only suspense which is supported in React 19. I expect that it should work exactly the same as when 'use client' is put at the top of the page.ts file in the app folder.