✖ No CONVEX_DEPLOYMENT set, run `npx convex dev` to configure a Convex project

I get the above in my Vercel build log and I can't find any documentation on the CONVEX_DEPLOYMENT env var. CONVEX_DEPLOYMENT was set for my local dev when I upgraded to convex 0.16.0, so that's cool, but what should it be for preview/production?
11 Replies
Michal Srb
Michal Srb2y ago
Hey @Mikael Lirbank , for production you should have the CONVEX_DEPLOY_KEY set in Vercel.
Mikael Lirbank
Mikael LirbankOP2y ago
I don't find any info in the Convex admin UI either. Just tried npx convex dev --configure=existing... but it didn't help. That one is set, this is another env var: CONVEX_DEPLOYMENT It is new per 0.16.0 I had these in Vercel since before: CONVEX_DEPLOY_KEY NEXT_PUBLIC_CONVEX_URL But a new env var emerged with 0.16.0 CONVEX_DEPLOYMENT
Michal Srb
Michal Srb2y ago
Could you get a new deploy key from the dashboard?
Mikael Lirbank
Mikael LirbankOP2y ago
It's not a deploy key.
Michal Srb
Michal Srb2y ago
Sorry, I should have been clearer. We introduced a new format of CONVEX_DEPLOY_KEY and I think the new CLI is not playing well with the old format. The new deploy key will look like prod:some-name-123|01d3....
Mikael Lirbank
Mikael LirbankOP2y ago
Aha, gotcha. I have to run but I'll try that later. But which env var does it go into? Are there any docs covering this?
Michal Srb
Michal Srb2y ago
New docs will be pushed, sorry about that. This is a bug in the new CLI, which should error about the deploy key format, not about CONVEX_DEPLOYMENT.
Michal Srb
Michal Srb2y ago
The release notes cover both environment variable changes. Apologies for the confusing experience. https://blog.convex.dev/announcing-convex-0-16-0/
Convex News
Announcing Convex 0.16.0
Convex 0.16.0 has been released! This release brings changes to the project configuration and other improvements. The main updates in 0.16.0 are: * Convex projects are configured via CONVEX_DEPLOYMENT environmental variable * CONVEX_DEPLOY_KEY has a new format * Authentication configuration moved from convex.json to convex/
Mikael Lirbank
Mikael LirbankOP2y ago
Cool, it works now. It seems NEXT_PUBLIC_CONVEX_URL redundant now, can I remove it or do I need to keep it?
ballingt
ballingt2y ago
NEXT_PUBLIC_CONVEX_URL is usually used in the frontend of your app to know which Convex deployment to connect to, so you probably need that too. If you _app.tsx or wherever you instantiate a ConvexReactClient uses that environment variable then you need to keep it.
Mikael Lirbank
Mikael LirbankOP2y ago
Ahh, that makes sense!

Did you find this page helpful?