Nuxt · NUXT0053

Use runtimeConfig instead of process.env in app code

Flags plain env in app code in Nuxt runtime code before it leaks into runtime behavior.
NUXT0053vite-doctor/nuxtruntime-configerrorSuggestion

Run this rule

pnpm nuxt doctor --rules nuxt/runtime/no-plain-env-in-app-code

Why it matters

Runtime configuration has different server and client visibility. Using the framework API keeps environment data typed and scoped.

Read configuration through useRuntimeConfig() instead of process.env in app code.

Example

Use runtime config in app code

Before

const apiBase = process.env.NUXT_PUBLIC_API_BASE

After

const apiBase = useRuntimeConfig().public.apiBase
Copyright © 2026