I'm getting a React hydration mismatch in a Next.js app. Diagnose the root cause and give me a minimal fix. Console error: {exact_error_text} Component(s) involved: {component_source} Diagnose which category this falls into before proposing a fix: 1. Non-deterministic render (Date.now(), Math.random(), or similar, executed during render instead of after mount) 2. Browser-only API accessed during server render (window, localStorage, navigator without a typeof window guard or a useEffect) 3. Invalid HTML nesting causing the browser to silently reparent elements (e.g.
inside

, inside ) 4. Server/client data mismatch (data fetched differently or at a different time on server vs. client, e.g. a cookie-dependent value read inconsistently) 5. Third-party script or extension mutating the DOM before hydration (explain if this is actually not fixable in app code) State which category applies and why, based on the specific error and code shown — don't just list all five as possibilities. Then give the minimal code change that fixes the root cause. Only suggest suppressHydrationWarning if the mismatch is truly unavoidable and intentional (e.g. rendering a live timestamp) — explain why in that case rather than silently reaching for it as a shortcut. --- Source credit for this prompt Original author: ai-prompt-library-team Original source: https://github.com/zidniryi/awesome-AI-prompt-library/blob/main/prompts/software-engineering/frontend/nextjs/debug-hydration-mismatch.md Source collection: https://github.com/zidniryi/awesome-AI-prompt-library License: CC BY 4.0 — https://creativecommons.org/licenses/by/4.0/ Source license: https://github.com/zidniryi/awesome-AI-prompt-library/blob/main/LICENSE-CONTENT Changes: Prompt text unchanged. Extracted from the source document; title and usage guidance added by LandingPagePrompts. Keep this credit when redistributing the prompt. No creator endorsement is implied.