Vue: [Vue warn]: Hydration text content mismatch / Hydration node mismatch: server rendered element contains more child nodes than client vdom
Server-rendered HTML differs from what the client renders on first load.
[Vue warn]: Hydration text content mismatchHydration node mismatch: - rendered on server: <div> - expected on client: <span>[Vue warn]: Hydration children mismatchHydration completed but contains mismatches[Vue warn]: Hydration class mismatch Meaning
Make first render deterministic: avoid Date.now(), Math.random(), window/localStorage checks in templates during SSR; render browser-only content inside onMounted or <ClientOnly> (Nuxt). Invalid HTML nesting (div in p) and extensions/CDN rewriting HTML also cause mismatches.
Common causes
- Random/date values in render
- Browser-only conditions (window width)
- Invalid HTML nesting
- Different data on server/client
- Browser extensions or CDN modifying HTML
⚡ Quick fix
- Move client-only logic to
onMounted/<ClientOnly> - Use stable ids/data (
useId) - Fix invalid HTML structure
Detailed fix by platform
Vue
const mounted = ref(false); onMounted(() => (mounted.value = true));
How to diagnose
- Value — Non-deterministic?
- Condition — Browser-only?
- HTML — Valid?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- ESLint Parsing error in .vue files ESLint: Parsing error: Unexpected token < / Parsing error: '>' expected (vue-eslint-parser not configured)
- Hydration error: <div> cannot be a descendant of <p> Next.js: Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p> / In HTML, <p> cannot be a descendant of <p>. This will cause a hydration error
- Hydration failed Error: Hydration failed because the initial UI does not match what was rendered on the server
Most viewed in Vue
- Property was accessed during render but is not defined Vue: [Vue warn]: Property "x" was accessed during render but is not defined on instance
- Failed to resolve component Vue: [Vue warn]: Failed to resolve component: x
- Avoid mutating a prop directly Vue: [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026