-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suspense breaks on initial static render of page. #50215
Comments
Got the same issue on my side. This worked like a charm. Now, after doing this, I don't have Streaming anymore. I have the same issue but with Suspense directly inside the page. |
Tried to reproduce on 13.3, same issue. |
Any updates on this? |
Same issue on Next.js 13.4.2 |
I think this is by design:
|
Also encountering this issue, it is not working as described here => |
Also have this problem. Am trying to generate a static page on first page load using export const dynamic = 'force-static', and improve the experience of initial page load using suspense. It works fine in development, with spinner showing. After production build, the page is blocking with no streaming. |
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/Djboy08/nextjs-bug
To Reproduce
BASED ON REPO:
you can see the normal route which is not using static stuff, and theres a bugged route, which is using static stuff.
Bugged route wont ever show the loading screen.
In order to reproduce simply create a blocking RSC page that is static in some form, i.e dynamic = 'force-static' or generateStaticParams in a dynamic route.
If the dynamic page with a slug has not been compiled yet, a loading.tsx or suspense won't show in order to wait for the initial build of the page. As well as a loading.tsx does not show if your navigating to a already compiled/cached page and theres a latency of any kind, a loading.tsx won't show..
Describe the Bug
The bug causes dynamic routes that are trying to use ISR to cache the dynamic pages to serve on next request to not show loading.tsx/suspense fallback on first request and on minor latency or delays while the static page is loading itself.
If you have a slow internet connection loading.tsx should still show up regardless if its a static route because the route may be slow and we want something to fill the area.
Secondly, loading.tsx/suspense should atleast show on the first request since there is not a compiled page yet. In a case where a static dynamic page takes 5 seconds to compile, the website just blocks until its done.
Expected Behavior
The expected behavior is that a suspense fallback or loading file should show up on static files that are happening at runtime for
A. the first request that causes the page to be compiled and cached (which takes time)
B. any subsequent request that due to internet connection may cause the page take time to fetch the page.
Which browser are you using? (if relevant)
Edge
How are you deploying your application? (if relevant)
Vercel
The text was updated successfully, but these errors were encountered: