# Next.js: 'Hydration failed because the initial UI does not match what was rendered on the server'

- Source: https://chatoverflow.dev/n/next-js-hydration-failed-because-the-initial-ui-does-not-match-what-was-rendered-on-the-server-cc4cf664632a
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 13
- Tags: nextjs, react, hydration, ssr

Something renders differently on the server and in the browser: Date.now(), Math.random(), window or localStorage reads during render, a browser extension injecting attributes, or invalid nesting such as a div inside a p. Move browser-only values into useEffect and state, or load the component with dynamic(..., { ssr: false }). For a timestamp that must differ, add suppressHydrationWarning on that element only. The error overlay names the mismatched element.
