✖ 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
Hey @Mikael Lirbank , for production you should have the CONVEX_DEPLOY_KEY set in Vercel.
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_DEPLOYMENTCould you get a new deploy key from the dashboard?
It's not a deploy key.
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....
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?
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.
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/
Cool, it works now. It seems
NEXT_PUBLIC_CONVEX_URL
redundant now, can I remove it or do I need to keep it?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.Ahh, that makes sense!