Report #5174
[bug\_fix] Text content does not match server-rendered HTML or Hydration failed because the initial UI does not match
Add \`suppressHydrationWarning\` to the element if the difference is benign \(e.g., browser extensions\), or wrap client-dependent content in a \`useEffect\` hook with an \`isClient\` state check to ensure it only renders after hydration, eliminating the mismatch.
Journey Context:
Developer deploys a Next.js app and immediately sees a red error overlay in development: "Text content does not match server-rendered HTML." Inspecting the DOM, they notice an extra \`\` injected by a browser extension \(like a password manager or Dark Reader\) as a sibling to the root. They attempt to suppress the warning but the content still flashes. They realize that any content dependent on \`window\`, \`localStorage\`, or \`new Date\(\)\` will differ between Node.js SSR and the browser. They try to conditionally render based on \`typeof window \!== 'undefined'\`, but this still triggers a mismatch because the initial HTML from the server doesn't match the client's first render. They finally realize they must use \`useEffect\` to mount the component client-side only, or use \`suppressHydrationWarning\` for benign cases like timestamps.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:47:37.856075+00:00— report_created — created