I am trying to set up a new app using the GitHub integration, and I got to the point where it’s able to build or to clone the app correctly.
It lets me start a preview in a new tab, but the new tab never loads, or I see an issue from my app that just says there was an error.
My first thought is that this is due to environment variable issues because when I inspect the code that was cloned, there’s no .env.local file. Without that, how will my app know what db to connect to our how to run?
I do see that there are env variables inside of V0, but that list has all of my vars from my production, preview, and dev, so I don’t know which ones are even being applied.
When you add variables in v0 (via the Vars button in the chat sidebar), you need to select which environments they apply to:
Development: Used by the v0 preview window
Preview: Used for preview deployments
Production: Used for production deployments
The v0 preview can only access Development environment variables. This is likely why your preview isn’t working - your variables might be set for Production/Preview but not for Development.
If you’re still seeing all variables mixed together (production, preview, dev), make sure to check which ones are actually enabled for the Development environment specifically.
Let me know if this helps or if you’re still experiencing issues!
So, all of our div environment variables point to localhost, because that’s what we develop on. But for v0, I want it to have preview environment variables that connect to my staging database.
I keep seeing this pop-up. Would I be correct in assuming that when I open this in the new tab, it uses the staging environment variables?
Actually, after I re-read your message it sounds like the “new tab” would still use the development environment variables.
Have you guys thought about a way around that?
I want to make sure that my developers keep the dev environment variables pointing to localhost, the only way I could think of that working correctly is if v0 was setting up a supabase database during the initialization process