Nuxt · NUXT0021

Use import.meta client/server flags

Flags process.client and process.server under Nuxt compatibility 5.
NUXT0021vite-doctor/nuxtcontextwarnAuto-fix

Run this rule

pnpm nuxt doctor --rules nuxt/context/no-legacy-process-client-server

Why it matters

Nuxt compatibility 5 removes the Nuxt type augmentation for process flags, while import.meta.client and import.meta.server remain typed runtime constants.

Use import.meta.client or import.meta.server.

Example

Use import.meta client flags

Before

if (process.client) {
  hydrateChart()
}

After

if (import.meta.client) {
  hydrateChart()
}
Copyright © 2026