Vercel loading production env variables in preview deployments
I'm deploying my project to Vercel and I'm having problems because even on Preview deployments the production environment variables are being loaded.
I have two databases and Firebase apps, one for production and one for dev, but it's always loading the production configs.
When printing
process.env.NODE_ENV
, the value is production
in both Preview and Production deployments.
Any tips?![](https://utfs.io/f/5044f89a-742a-4ec7-81c1-b89ce9ca9f90-1nq2cb.png)
3 Replies
NODE_ENV
is not meant for "production", "staging", "preview", it usually used to indicate the build environment, which mostly used by build tool.use
VERCER_ENV
instead of NODE_ENV
Thanks, guys!