NuxtHub Deploy use my local .env values instead in Nuxthub admin dashboard
Closed this issue · 2 comments
bitmanid commented
Description
When deploying with npx nuxthub deploy, the deployment process appears to override the environment variables set in the NuxtHub admin dashboard with local .env file values. This creates inconsistency in environment management between local development and production deployments.
Current Behavior
- Local .env file values are being used in production deployments
- Environment variables set in the NuxtHub admin dashboard are being ignored/overridden
- Environment variables set in the NuxtHub admin dashboard didn't change, but value was using my local .env value
Questions
- Is this the intended behavior?
- Is there a specific deployment flag or configuration to prioritize dashboard environment variables?
- Should we be handling .env files differently during deployment? Or should i use .env.local instead .env in my local development?
atinux commented
Only build time env variables will be overwritten by your local .env (ex: used in nuxt.config.ts)
You can have a .env.prod file for instance for the prod env variables and use npx nuxthub deploy --dotenv .env.prod