Error AtlasError Documentation and Resolution

Next.js hydration mismatch

Text content does not match server-rendered HTML

The server HTML and the first browser render disagree. React cannot reliably attach the client tree to the prerendered markup until that mismatch is corrected.

Text content does not match server-rendered HTMLrendering
Text content does not match server-rendered HTML
  • Time, locale, random values, or browser storage change the initial output.
  • Invalid HTML nesting lets the browser repair markup before hydration.
  • An extension or CDN modifies the delivered HTML.
  1. Locate the differing element in the hydration error and compare server output with the first client render. Check HTML nesting before changing rendering modes.
  2. Render the same initial content on both sides, then read browser-only state in useEffect. A use client directive alone does not disable server prerendering.
  3. For an inherently browser-only widget, consider a targeted dynamic import with SSR disabled from a Client Component. Do not disable SSR across the whole site just to hide a mismatch.
  4. Use suppressHydrationWarning only for an unavoidable single-level mismatch such as a timestamp; it is an escape hatch and React will not patch the mismatched text.
Next.js official documentation