Vite · VITE0011

Type Vite environment variables

Flags untyped env in Vite env code before it leaks into runtime behavior.
VITE0011vite-doctor/vitetypeswarnNo fix

Run this rule

pnpm vite-doctor . --framework vite --extends auto,vite/strict --rules vite/env/no-untyped-env

Why it matters

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

Remove untyped env, or move it to the Vite runtime/API that owns that behavior.

Example

Type import.meta.env access

Before

const apiBase = import.meta.env.VITE_API_BASE

After

interface ImportMetaEnv {
  readonly VITE_API_BASE: string
}

const apiBase = import.meta.env.VITE_API_BASE
Copyright © 2026