Default env vars aren't being used on new preview deployments

I'm using Next.js with Convex and Better Auth, deploying through Vercel. Currently trying to set up a preview deployment. I've set up a bunch of default env vars in the Convex project settings to be used on preview deployments, but when I deploy from Vercel, the convex build push fails because it's missing some env vars, and when I look at the env vars for the new convex preview deployment, it doesn't have any env vars set. Is there anything else I need to set to get the default env vars to show up in new preview deployments? I've scoured the docs / discord but haven't seen anything else.
3 Replies
Convex Bot
Convex Bot3w ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
erquhart
erquhart2w ago
Silly question, but can you confirm the project you're deploying is definitely the one with the defaults set? Second, is there any chance this preview deployment was already created before setting the defaults? It wouldn't be affected if so. You can try a new preview deploy from a new branch to confirm this.
PacifismPostMortem
Yup I've linked Vercel via the preview deployment key with my project and it deploys to the correct project I tested with a new branch and that was it, I didn't realize I had to set the default variables before ever deploying from that branch, I had been just redeploying the existing branch, thanks for the help!

Did you find this page helpful?