-
Notifications
You must be signed in to change notification settings - Fork 46.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
React 18 bug: Uncaught Error when renderToString on server and hydrateRoot on client for Suspense lazy component #24125
Comments
Facing same issue! |
Also facing this issue |
@SuperOleg39 I tried the linked codesandbox but could not reproduce the issue. Did you forget to freeze the codesandbox and made changes after posting this issue? Does this reproduce for you 100%? Which browser/OS are you using? |
@eps1lon I'm found this on MacOS, Chrome 99 Still reproduce the error, when open demo in new window. |
Important step - this works only for first page load from the server |
In my case I'm on Windows and chrome 99 |
This is using This case doesn't happen if The solution is to switch to the streaming API on the server. That's why it's important to upgrade both the server and the client as part of the React 18 upgrade. |
One thing we could probably due is log a The warning can suggest upgrading to the streaming api in that scenario. |
Same issue in Next.js
|
@sebmarkbage thanks for the complete answer! |
Hello @SuperOleg39, would you be able to further detail it a bit? I'm facing the same issue still and i must admit did not get what was your solution. I'm not doing nothing fancy in my case, as @nghieptiki I'm just using nextjs 12.1.1 with react 18, and lazy loading some svgs, and i was not facing this issue before 🤔 |
Hey @lveillard from Next.js vercel/next.js#35564 (comment)
|
Can you clarify what you mean by this? |
I talking only about react@18 behaviour with |
Oh, sorry, this comment was not for me 🤦 |
Another user (Windows, Edge, Remix.run) getting this error, but the site is rendering fine; it would be nice to know how to clear the error though. |
Hello!
I get the uncaught error while hydration Suspense component, but except this error, looks like hydration working correctly - fallback changed to lazy component successfully.
Prerequisites
react@18.0.0-rc.2
renderToString
on server andhydrateRoot
on clientSuspense
+lazy
componentReproduction
Forked sandbox from Upgrading to React 18 on the server - https://codesandbox.io/s/modest-cdn-we3fvr
Error
Component example
The text was updated successfully, but these errors were encountered: