ckobasti
ckobasti12mo ago

Deployment to Production

What should i do t o switch from deployment to production? I already published my Next app on vercel but my production deployment wont work even tho i added
CONVEX_DEPLOY_KEY
CONVEX_DEPLOY_KEY
and
npx convex deploy --cmd 'npm run build'
npx convex deploy --cmd 'npm run build'
as a build command. Should i change my
.env
.env
at another point or?
No description
14 Replies
Indy
Indy12mo ago
Sounds like you've followed this guide: https://docs.convex.dev/production/hosting/vercel#deploying-to-vercel I am not sure what Vercel does with .env if it's checked in. I'd double check: 1. Double check if .env is even checked in (ideally it isn't) 2. There isn't a different CONVEX_DEPLOY_KEY in your .env file
Using Convex with Vercel | Convex Developer Hub
Host your frontend on Vercel and your backend on Convex.
ckobasti
ckobastiOP12mo ago
this is my
.env.local
.env.local
, i dont have anything about convex in
.env
.env
.. First env variable and last one are same tho..
No description
ckobasti
ckobastiOP12mo ago
And i took that from Settings > Generate Key, @Indy isnt that what the docs say? but it assumes im working with react so idk never tried convex with pure react maybe thats the issue
sshader
sshader12mo ago
The CONVEX_DEPLOY_KEY should be set in the Vercel environment variables UI (step 4 in https://docs.convex.dev/production/hosting/vercel has an image). Does this error happen with the environment variable set there?
Using Convex with Vercel | Convex Developer Hub
Host your frontend on Vercel and your backend on Convex.
ckobasti
ckobastiOP12mo ago
Its set there aswell of course
ckobasti
ckobastiOP12mo ago
Btw @sshader those 2 are the same and its link from the next picture
No description
ckobasti
ckobastiOP12mo ago
No description
sshader
sshader12mo ago
This was what I was referring to (different from the .env file) Another thing to check -- what version of Convex are you running (from the package.json or from changing the command to npx convex --version to see what it prints)
No description
ckobasti
ckobastiOP12mo ago
I thought those 2 are the same.. sent wrong pic
No description
ckobasti
ckobastiOP12mo ago
And my version is 1.6.3 should i update to latest?
ballingt
ballingt12mo ago
1.6.3 should be ok here hm yes I'd update to latest
ckobasti
ckobastiOP12mo ago
No description
ckobasti
ckobastiOP12mo ago
convex is on v1.7.1 now
ballingt
ballingt12mo ago
Your package.json sounds unusual here, what's the entry for "build" there?

Did you find this page helpful?