Nuxt · NUXT0086

Give ClientOnly a server fallback

Finds <ClientOnly> components without a server fallback, which render an empty element on the server and shift the layout once their content mounts.
NUXT0086vite-doctor/nuxthydrationinfoSuggestion

Run this rule

pnpm nuxt doctor --extends auto,nuxt/strict --rules nuxt/hydration/require-clientonly-fallback

Why it matters

On the server, and until the component mounts, <ClientOnly> renders only its fallback. Without a #fallback slot or a fallback, placeholder or fallback-tag prop that is an empty <span>, so the client-only content appears after hydration and pushes the surrounding layout.

Add a #fallback slot with a placeholder of the same size, such as a skeleton, or set fallback-tag with classes that reserve the space. Prefer server-rendered markup when the content does not need the browser. Doctor skips <ClientOnly> wrappers whose only children are Teleport or overlay components such as modals, dialogs, drawers and toasts, and <ClientOnly> with a v-bind object, because those can pass a fallback Doctor cannot see. This Rule is opinionated, so it is only in the Strict Preset.

Example

Reserve the space with a fallback

Before

<template>
  <ClientOnly>
    <SalesChart :data="data" />
  </ClientOnly>
</template>

After

<template>
  <ClientOnly>
    <SalesChart :data="data" />
    <template #fallback>
      <USkeleton class="h-80 w-full" />
    </template>
  </ClientOnly>
</template>
Copyright © 2026