Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Runtime config environment variables do not override default values with cloudflare-pages preset #25925

@niklaswolf

Description

@niklaswolf

Environment

  • Operating System: Darwin
  • Node Version: v20.10.0
  • Nuxt Version: 3.10.3
  • CLI Version: 3.10.1
  • Nitro Version: 2.8.1
  • Package Manager: [email protected]
  • Builder: -
  • User Config: devtools, runtimeConfig
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-6r61tu

  • in normal dev-mode everything works fine, the value from the .env file is printed
  • if you build the app with cloudflare-pages preset and then run it via npx wrangler pages dev dist/ --port=3000, you'll see that the cli says that the variables from .dev.vars are picked up, but they aren't used as the app prints the default value from runtime config

Describe the bug

When building the app with cloudflare-pages preset, the env-variables for runtime config are not used in the app correctly.

Additional context

No response

Logs

✨ Compiled Worker successfully
 ⛅️ wrangler 3.29.0
-------------------
Using vars defined in .dev.vars
Your worker has access to the following bindings:
- Vars:
  - NUXT_PUBLIC_TEST_VALUE: "(hidden)"

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions