Nitro · NITRO0026
Read server settings from runtime config, not process.env
Flags process.env reads in Nitro server files.
nitro/runtime/no-process-env-in-serversrc/rule-packs/nitro/rules/no-process-env-in-server.ts Upstream docs Run this rule
pnpm vite-doctor . --framework nitro --rules nitro/runtime/no-process-env-in-server
Why it matters
Nitro maps NITRO_ and NUXT_ environment variables onto runtimeConfig at startup, with types and defaults in one place. process.env is empty on Cloudflare Workers and other runtimes without a Node process, and a key read straight from it bypasses that contract.
Recommended fix
Declare the setting in runtimeConfig and read it with useRuntimeConfig(); override it with NUXT_<KEY> or NITRO_<KEY> at runtime.
Useful links
Example
Read the mail sender from runtime config
Before
const from = process.env.MAIL_FROM
After
// nuxt.config.ts: runtimeConfig: { mailFrom: '' }, set with NUXT_MAIL_FROM
const { mailFrom } = useRuntimeConfig()