I’ve got some env vars set up in my Netlify UI. However, the local development values are showing up in my production builds. The local value is correct, so it’s pulling the correct env var key. What am I missing?
If you deployed using the CLI, that’s expected. If not, please share site details to check.
I deployed via the UI, drag and dropped my build dir. Here’s a screenshot of the site details (lmk if this isn’t what you were looking for)
Yeah, as mentioned, this is expected. You built via CLI, Netlify used your local environment variables. If you build via Git, your production variables would be used.
Apologies for the confusion. Building with the UI is akin to building via CLI? Guessing the UI is using the CLI in the background. Is there a way to do this without Git?
No, the UI doesn’t do any building unless you deploy via Git. Drag-n-drop deploy does not involve any building. You’re building the site locally.
For Netlify to be able to use your production variables, it needs to do a production build. Building using CLI is not a production build.
Not that I’m aware of. You can keep the variable value same for production and CLI, but if you’ve set it differently, you must have a reason.
For manual deploys, the only deploy you can make is production, since there cannot be a branch deploy or a deploy preview without a Git repo.
Sounds good, deploying with Git now and it’s working as expected. Thanks