Skip to content

Issue with runtimeConfig + layers in production when certain conditions are met #24215

@Maiquu

Description

@Maiquu

Environment

  • Operating System: Linux
  • Node Version: v20.9.0
  • Nuxt Version: 3.8.1
  • CLI Version: 3.9.1
  • Nitro Version: 2.7.2
  • Package Manager: pnpm@8.9.2
  • Builder: -
  • User Config: devtools, extends, runtimeConfig
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Reproduction repository: https://github.com/Maiquu/nuxt-bug-reproduction

Since this is a build-only issue, I haven't included a StackBlitz link. I included notes in README about the issue.

Describe the bug

If all of the following conditions are met, the build output will not read environment variable equivalents of runtime configuration keys that were undefined at build time.

  • Main app should extend a layer which is defined as a node module.
  • Extended layer should have runtimeConfig defined with any number of values.

Build output will not be flawed if extended layer is defined as a relative path. (EDIT: This is incorrect, layer type does not matter)

Can be worked around by giving a default value for any runtimeConfig expression that can be undefined during build.

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