Nuxt · NUXT0031
Avoid client-only conditionals in SSR templates
Flags client conditional in template in Nuxt hydration code before it leaks into runtime behavior.
nuxt/hydration/no-client-conditional-in-templatesrc/rule-packs/nuxt/rules/nuxt/no-client-conditional-in-template.ts Upstream docs Run this rule
pnpm nuxt doctor --rules nuxt/hydration/no-client-conditional-in-template
Why it matters
Server-rendered markup must match the first client render. Browser-only state, time, randomness, or hash-sensitive URLs can create hydration mismatches.
Recommended fix
Remove client conditional in template, or move it to the Nuxt runtime/API that owns that behavior.
Useful links
Example
Use ClientOnly for client conditions
Before
<template>
<p v-if="import.meta.client">Client only</p>
</template>
After
<template>
<ClientOnly>
<p>Client only</p>
</ClientOnly>
</template>