How to set environment variables in wrangler pages dev
for Nuxt + Cloudflare Pages project?
#7976
Labels
pages
Relating to Pages
I'm building a Nuxt 3 application deployed on Cloudflare Pages, and I'm having trouble getting environment variables to work with
wrangler pages dev dist/
during local development.Setup
What I've tried
pnpm wrangler pages dev dist --binding NUXT_PUBLIC_CONSOLA_LEVEL="test value"
Testing Code
Results
According to Nuxt documentation, any environment variable starting with NUXT_PUBLIC_ should automatically override the corresponding runtime config value. This works in development but not when testing the production build with Wrangler.
What am I missing? How can I get environment variables working correctly when using
wrangler pages dev
?The text was updated successfully, but these errors were encountered: