Getting an error when trying to deploy a convex preview environment
I've followed the following docs 'https://docs.convex.dev/production/hosting/vercel' which work great for the production deploy, but I receive an error when deploying to a preview environment.
I'm using Vercel as a hosting provider and am running the latest versions of convex with node 20.
I'm receiving the following error message:
The first part of my
CONVEX_DEPLOY_KEY
environment variable is: preview:[org-name]:[proj-name]|01xyz...
.
Do you guys know what might be the issue?6 Replies
I've also dug around in the code and it seems to originate from the following code:
https://github.com/get-convex/convex-backend/blob/af95bf5446618a9d9be82a320b64091e947d8dd6/npm-packages/convex/src/cli/deploy.ts#L204
But going through the calls that it's making it seems fine deducing the product name etc... from preview key
GitHub
convex-backend/npm-packages/convex/src/cli/deploy.ts at af95bf54466...
Open source single-machine version of the Convex backend - get-convex/convex-backend
Hmm, I cannot reproduce this. Can you reproduce it from your terminal?
You can run
Thanks for the quick response, and locally it does work. However in the vercel deploy I still receive the same error. Is there something I can do to get some additional logs?
Some other things to check -- is
CONVEX_DEPLOY_KEY
configured to that same value for the preview environment in Vercel? If you echo
it in your build command does it print what you expect? If you change your build command temporarily to npx convex deploy --preview-create TEST
(which worked locally), what happens in Vercel?
There's a --verbose
flag to npx convex deploy
but it might not actually give us a ton more informationYes I've tried
--preview-create TEST
this one but to no avail. Echoing CONVEX_DEPLOY_KEY prints the expected value
I can provide my project name and org name so perhaps you can see something in the logs?
Now I'm just running the following for a simplified test: npx convex deploy --preview-create TEST-321
but still receiving the error, but only in vercel, locally it worksSharing the project + team names (the prefix of your preview deploy key) with us would be helpful (feel free to share over DM)