- How you use it
- You ask for it
- What it can do
- writes files · runs shell
- What's inside
The option
| Option | ASkill · v1.0.0Scan JSX/TSX for common Next.js hydration-mismatch causes |
|---|---|
| How you use it | You ask for it |
| What it can do | writes files · runs shell |
| What's inside |
What this thread does
Do first: move window, localStorage and browser-local time reads out of rendering into useEffect, keeping identical server and first-client placeholders.
Short answer
As of November 2026, Next.js 16.4.6 is the reference baseline. Text content does not match server-rendered HTML means the initial trees differ. Fix the cause, isolate a browser-only widget if necessary, and reserve suppression for one unavoidable text difference.
Choose / don't choose
- Matching initial markup: choose for content that can be rendered deterministically; don't use
typeof windowto select a different first-render tree. - Client update after mount: choose for browser preferences, storage and local time; don't hide the entire page when only one label needs replacement (React hydration).
- Isolated browser widget: choose disabling prerendering for a Client Component; don't disable SSR for unrelated page content (lazy loading).
- Intentional text difference: choose suppression only when accepting the difference; don't expect it to repair the text.
Not for: Zustand state shared between requests; see zustand-nextjs-app-router-store-per-request.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
suppressHydrationWarning | true on the single differing element; one level only; mismatched text is not patched | Current Next.js docs | error guide |
ssr | false disables prerendering for a Client Component; place the dynamic import in a Client Component, not a Server Component | Current App Router docs | lazy loading |
useEffect dependencies | [] for a mount-only browser read; first render retains the server placeholder | Current React docs | hydrateRoot |
formatDetection | { telephone: false, email: false, address: false } when automatic links alter the intended DOM | Current App Router docs | metadata |
meta[name="format-detection"] | content="telephone=no, date=no, email=no, address=no" also disables date recognition | Current Next.js error guide | iOS guidance |
Use format detection only when browser linkification causes unwanted structural changes; provide intentional telephone/email links yourself when they are useful. The documented Metadata object does not include a date field; the explicit meta example does.
Order of operations
1. Compare response HTML, the browser-parsed DOM and initial React inputs before effects. Check invalid paragraph/list/interactive nesting, browser extensions, CSS-in-JS setup and CDN HTML rewriting (cause list). 2. Replace time/random/storage-dependent first-render values with stable serialized data or a shared placeholder. Run browser-dependent updates after mount; prefer CSS for viewport-only layout changes. 3. If a browser-only library remains, isolate its dynamic import. Client Components are prerendered unless SSR is explicitly disabled; a client directive alone does not opt out. 4. Exercise a fresh document load and client navigation with identical data, different locale/timezone/storage settings, and mobile link detection. Inspect the rendered content as well as console diagnostics: suppression can conceal stale text. Repeat without extensions, then through the actual CDN configuration.
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
Text content does not match server-rendered HTML | Browser-only window/localStorage APIs, time-dependent Date(), or incorrect HTML nesting | Make initial inputs deterministic; correct nesting and defer browser reads | Next.js error guide |
ssr: false is not allowed | Disabling SSR from a Server Component | Move that dynamic import into a narrowly scoped Client Component | App Router restriction |
The historical Discussion #35773 contains independent mismatch reports, not a single universal fix.
Missing
- No route HTML or component source identifies this page's actual mismatch. The community Back-button/blank-page anecdote has no established reproduction here; preserve meaningful server content rather than applying a page-wide mount gate.
Started from a post by @Next.js (Vercel), packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.