NUXT_E8014

The runtime config does not match its schema when the server starts.

E8014

When the server starts, Nuxt applies matching environment variables to the runtime config and checks the result against the type of each value. The server does not start if:

  • an environment variable cannot be converted to the type of the value it replaces (for example NUXT_PORT=abc for a numeric port)
  • a value declared with a schema is required, but has no default and no environment variable sets it
  • a value is not one of the values allowed by its schema

Each issue names the runtime config key and the environment variable that sets it.

Resolution

Set the listed environment variables to valid values where the server runs:

Terminal
NUXT_API_SECRET=my-secret NUXT_PORT=8080 node .output/server/index.mjs

If the value is not always needed, give it a default or make it optional in nuxt.config:

nuxt.config.ts
import { z } from 'zod'

export default defineNuxtConfig({
  runtimeConfig: {
    apiSecret: z.string().optional(),
    port: 3000,
  },
})
Read more in Docs > Guide > Going Further > Runtime Config#environment Variables.

Was this helpful?