Project connects to DB even without ENV Variable

So I just deployed a SvelteKit project that makes use of some environment variables to connect to a DB
To my surprise, I deployed to Vercel, and even when I didn’t set up any Environment variable from the dashboard, the site was able to connect to the DB

I was expecting the connection to fail until I manually set the env variables.

What I noticed when I go to the source of the deployment is that the .env local file was deployed. Is that where it’s reading the values from?

If so. Is this normal behavior?

What if I .env file contains connections to development DB and I need the production one to be different?

(I guess I can .vercelignore the .env file, or maybe just create the env variable on the dashboard and it will override whatever is on .env file?)

If a .env file was included in the repo, then that may have been used. I wouldn’t expect a .env.local to be used in an automated deployment, but it seems plausible that it could have been used if you deployed with the CLI. I believe there are also some other ways to configure variables in SvelteKit which could be the reason your connection variable is present in the deployment.

Ultimately, I’m just guessing without knowing your project setup and deployment steps. If you can describe the project more, or share a minimal reproducible example, that would help me investigate what’s actually happened. :slightly_smiling_face: