Skip to content

vue-doctor/nuxt/nuxt-no-process-env-in-client ​

Use useRuntimeConfig(); expose client values through runtimeConfig.public in nuxt.config

PropertyValue
CategoryNuxt
Default Severitywarning
Confidencemedium
FixableNo
Engineoxlint
Sincev1.0.0
Frameworksnuxt
Test filesNot checked (which files)

Why it matters ​

Use useRuntimeConfig(); expose client values through runtimeConfig.public in nuxt.config

How to fix ​

Review the finding and update the code according to best practices below.

Agent Guidance ​

Only files that end up in the client bundle are checked (components, pages, layouts, composables, non-.server plugins, app middleware, stores, utils, app.vue); server/, scripts/, shared/ and config files run in Node and may read process.env. Read configuration with useRuntimeConfig(). Declare values in runtimeConfig (server-only) or runtimeConfig.public (client) in nuxt.config.


Rule source: vue-doctor/nuxt/nuxt-no-process-env-in-client

Released under the MIT License.