-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
dynamic import with suspense:true, ssr:false
causes The server could not finish this Suspense boundary
error
#36636
Comments
The server could not finish this Suspense boundary
errorsuspense:true, ssr:false
causes The server could not finish this Suspense boundary
error
You can remove the |
@huozhi removing |
I wonder if there is any progress with that? In case I was trying tutorial with useSWR and suspense and I don't need all the latest functionalities how could I use earlier versions of the next and react? |
The Babel plugin works fine, so it seems not a runtime issue. fixes #36636
It appears that this still doesn't work as expected. I adapted the codesandbox, to use By doing this the app throws an error again because the component is getting rendered on the backend. https://codesandbox.io/s/cool-dew-oengrx?file=/pages/index.js |
still experiencing this issue |
@bkyerv are you using next@canary or stable? If stable then please use next@canary to check if you're still running into it. |
@shkreios That's because react will resolve the suspense on server side with react lazy, so if you throw an error (calling dom api on server side for your case) SSR will fail. In the future we might introduce some way to let you skip the error. But the behavior is as expected now. |
Any progress on this? I have a similiar requirement of using |
React trying to resolve the suspense on server side with suspense mode What we can change the behavior in the future is to track all recoverable react rendering errors thrown on server side and decide which one can be dropped. It's not able to achieve with the current version, we're still designing the solution for it in progress. I'll close this issue for now and once we'll post more details in community once we have a clear solution |
Is there any workaround for this? How to fix code that throws on server? We have a page component with a hook that needs to be run on the client. It throws on pre-rendering with |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Update: you could try the latest canary (>= 13.0.7-canary.5) now, we have migrated |
Verify canary release
Provide environment information
Describe the Bug
Using dynamic component import with
{suspense: true, ssr:false}
cause this error:Important Note: functionally this works correctly, the issue is just that an error is being generated and so it appears broken
Expected Behavior
Should work without any error popup or error in browser console
To Reproduce
Runable reproduction: https://codesandbox.io/s/dank-sound-pkxopr?file=/pages/index.js
Other
You can also cause this same behavior with this next.js page:
The text was updated successfully, but these errors were encountered: