-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
Server Side Rendered portals - Warning: Expected server HTML to contain a matching <h1> in <div>
#25489
Comments
This comment has been minimized.
This comment has been minimized.
This problem is caused by the inconsistency between the server's first rendering and the client's. We can restrict data rendering to the DOM only when the next arrives on the client.
|
I'm seeing a lot of hydration errors as well. In my case I have a cart state that is persisted locally using localStorage. When a user removes all items from their cart and refreshes their cart (Causing server to load) - the hydration error appears. I'm not sure if this is the following approach (is there a better approach to this issue:
Considering my application is an ecommerce app and a lot of the components rely on the |
This appears to be fixed, as following the reproduction steps, I cannot see a warning anymore. |
This comment was marked as off-topic.
This comment was marked as off-topic.
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. |
What example does this report relate to?
with-portals-ssr
What version of Next.js are you using?
10.1.3
What version of Node.js are you using?
14.15.5
What browser are you using?
Chrome
What operating system are you using?
Windows (running on WSL)
How are you deploying your application?
next
Describe the Bug
Expected Behavior
A clear console without this type of error/warning.
To Reproduce
Install the example
Run the project
cd with-portals-ssr-app npm run dev
Open localhost:3000, open DevTools.
The text was updated successfully, but these errors were encountered: