Hydration Mismatch Error in Next.js When Server Rendered HTML Doesn't Match Client #77039
Unanswered
yinggangtian
asked this question in
Help
Replies: 1 comment 2 replies
-
Error: Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:
It can also happen if the client has a browser extension installed which messes with the HTML before React loaded. https://react.dev/link/hydration-mismatch <HotReload assetPrefix="" globalError={[...]}>
<AppDevOverlay state={{nextId:1, ...}} globalError={[...]}>
<AppDevOverlayErrorBoundary globalError={[...]} onError={function bound dispatchSetState}>
<ReplaySsrOnlyErrors>
<DevRootHTTPAccessFallbackBoundary>
<HTTPAccessFallbackBoundary notFound={<NotAllowedRootHTTPFallbackError>}>
<HTTPAccessFallbackErrorBoundary pathname="/" notFound={<NotAllowedRootHTTPFallbackError>} ...>
<RedirectBoundary>
<RedirectErrorBoundary router={{...}}>
<Head>
<link>
<script>
<script>
<script>
<Layout>
<RootLayoutClient>
<html
lang="en"
- className="light"
- style={{color-scheme:"light"}}
>
<head>
...
<div ref={{current:null}} className="about-pane...">
<section id="whoami" className="section">
<div className="text-center">
+ rgb(0, 122, 122)
- rgb(5 206 145)
...
...
...
...
...
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Link to the code that reproduces this issue
https://github.com/tianyinggang/blog/tree/nextjs15
To Reproduce
useEffect
or similar hooks that cause a mismatch between initial HTML and hydration.Current vs. Expected behavior
Current:
Provide environment information
Which area(s) are affected? (Select all that apply)
CSS, Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions