Nitro · NITRO0032
Do not send the whole runtime config in a response
Report Nitro handlers that return the whole object useRuntimeConfig() gives them: the config itself or a const bound to it, an object literal ending in a spread of it, or an object literal with it as a property value, also when serialized with JSON.stringify() or Response.json().
nitro/runtime/no-runtime-config-in-responsesrc/rule-packs/nitro/rules/no-runtime-config-in-response.ts Upstream docs Run this rule
pnpm vite-doctor . --framework nitro --rules nitro/runtime/no-runtime-config-in-response
Why it matters
useRuntimeConfig() returns every runtimeConfig key, including the private ones that stay on the server and that Nitro fills from NITRO_ and NUXT_ environment variables, such as API secrets and database URLs. Nuxt only sends runtimeConfig.public and app to the browser; a handler that returns the whole object sends the rest to any client that calls the route. Doctor only checks what the handler's own return statements send. It does not report single keys or groups such as config.stripe, values nested deeper than one object literal, or properties a later spread or key can overwrite.
Recommended fix
Return only the fields the client needs, such as config.public.siteUrl, and keep values meant for the client under runtimeConfig.public.
Useful links
Example
Return the public value the client needs
Before
export default defineEventHandler((event) => {
const config = useRuntimeConfig(event)
return { ok: true, config }
})
After
export default defineEventHandler((event) => {
const config = useRuntimeConfig(event)
return { ok: true, site: config.public.siteUrl }
})