Next.js renders your page to HTML on the server. React then rebuilds the page in the browser and compares it with that HTML. The two have to match, and here they did not.
Code that reads the current time, window or localStorage while rendering gives a different answer on the server than in the browser. Invalid HTML nesting, browser extensions and CDN settings that rewrite the HTML can do the same.
How to fix it
Read the full error in the browser console. It names the element that differs. Start there.
Check your HTML nesting. A p inside another p, a div inside a p, or a ul inside a p is invalid. So is a link inside a link or a button inside a button. Change the tags.
Look for values that change between server and browser: new Date(), Math.random(), window, localStorage, or a check like typeof window !== 'undefined' inside your render code.
Move those values into an effect, so the first render matches the server and the browser fills in the real value after it loads.
import { useState, useEffect } from 'react'
export default function App() {
const [isClient, setIsClient] = useState(false)
useEffect(() => { setIsClient(true) }, [])
return <h1>{isClient ? 'This is never prerendered' : 'Prerendered'}</h1>
}
If one component only makes sense in the browser, turn off server rendering for it. This option only works inside a Client Component, so the file must start with 'use client'.
For a value that will always differ, such as a timestamp, add suppressHydrationWarning to that one element. It works one level deep and the docs call it an escape hatch.
I would try this one first, because it takes ten seconds. Open the page in a private window with extensions off. If the error goes away, a browser extension was changing the HTML.
If the error only shows on iPhones, iOS may be turning phone numbers or emails into links. The Next.js docs give a format-detection meta tag to switch that off.
If you use a CDN such as Cloudflare, check that it is not minifying or rewriting your HTML.
Questions
What is a hydration error in Next.js?
It means the HTML rendered on the server differs from what React rendered in the browser on first load. Dates, window, localStorage and invalid HTML nesting are the usual causes.
Is suppressHydrationWarning a real fix?
Only for content that must differ, like a timestamp. The Next.js docs call it an escape hatch that works one level deep. Fix the real difference first.
The free health check asks ten questions about your app and shows the three fixes to do first. It runs in your browser.
If you would rather have someone read the code, the fixed-price audit is $497 one-time. It covers security and scaling, with a written report ranked by severity.