Skip to content

Runtime config objects not replaced by env variables #1830

@becem-gharbi

Description

@becem-gharbi

Environment

  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.7.4
  • CLI Version: 3.9.0
  • Nitro Version: 2.6.3
  • Package Manager: npm@9.4.2
  • Builder: -
  • User Config: devtools, runtimeConfig
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-e6syfm-bu4rgq?file=nuxt.config.ts

Describe the bug

As described in docs, matching env variables should replace runtime config properties.

However, a property with primitive and non-primitive type (e.g boolean | object) cannot be replaced.

  runtimeConfig: {
    public: {
      feature: {   // Setting `NUXT_PUBLIC_FEATURE=false` has no effect
        option: true,
      },
    },
  },

Additional context

Related issues

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions