Nitro · Runtime config

NITRO0008Pass event to useRuntimeConfig in server handlers

Read runtime config with the Nitro event inside server handlers.

Why it happens

Passing the event lets Nitro resolve request-aware runtime config consistently in server code.

Fix

Use useRuntimeConfig(event).

Example

Pass event to runtime config

Before

export default defineEventHandler(() => {
  return useRuntimeConfig().apiSecret
})

After

export default defineEventHandler((event) => {
  return useRuntimeConfig(event).apiSecret
})

Verify the fix

Run only this rule after editing so the report stays focused on the diagnostic you are closing:

pnpm vite-doctor . --framework nitro --rules nitro/runtime/require-event-runtime-config-in-server
Copyright © 2026