Sorin
Sorinโ€ข4w ago

Vercel deploy breaks for preview

This week, vercel Preview deployments that were using prod DEPLOY_KEY started to break with:
Detected a non-production build environment and "CONVEX_DEPLOY_KEY" for a production Convex deployment
This is probably unintentional.
Detected a non-production build environment and "CONVEX_DEPLOY_KEY" for a production Convex deployment
This is probably unintentional.
I don't know how to get around this as vercel is doing a preview build that is promoted to production after it's done. I understand the requirement for pro account with preview builds... but we should be able to choose to use same be for both. or at least mentain the existing featureset. I saw no announcement in this regard... Maybe this is connected... on project: https://dashboard.convex.dev/t/sorin-2a17b/test-automuse-repo/notable-crow-732 I created a DEPLOYMENT_KEY, added it to vercel, but the convex deploy returns:
Running "npx convex deploy --cmd 'npm run build'"
sh: line 1: /vercel/path0/node_modules/.bin/convex: Permission denied
Running "npx convex deploy --cmd 'npm run build'"
sh: line 1: /vercel/path0/node_modules/.bin/convex: Permission denied
was there any recent change that could causet this on convex side?
Convex Dashboard
Manage your Convex apps
9 Replies
Convex Bot
Convex Botโ€ข4w 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!
Sorin
SorinOPโ€ข4w ago
๐Ÿ™„
Sorin
SorinOPโ€ข4w ago
For correlation: I so have a opened git issue. https://github.com/get-convex/convex-backend/issues/166
GitHub
Deployment fails on Vercel with: bin/convex: Permission denied ยท I...
I am running a new project and I want to deploy the FE to Vercel. (did this a few times before) I am on the free tier. I have set the CONVEX_DEPLOY_KEY (did multiple checks...) with the value from ...
ballingt
ballingtโ€ข4w ago
@Sorin responded about the GitHub issue there, but re the top issue in this thread: you probably don't want to deploy to prod for preview deploys, right?
I don't know how to get around this as vercel is doing a preview build that is promoted to production after it's done.
Is this a new workflow in Vercel? We might need new instructions if this is the case, e.g. using prod for the functions
Sorin
SorinOPโ€ข4w ago
the permission denied was my fault. I committed by mistake the node_modules. Removed it from Git and after some back and fw, it works again. I'll investigate the other "preview" related issue, but most likely I also did something wrong over there. Bot projects are PoCs and things move a lot in them. in the "permission denied" I am trying to do a super fast path to public builds with Next + Convex + Clerk + Google SSO I am automating the interactions with clerk and vercel trough nodeJS scripts. that's providers config plus env vars and some react code . - btw: I managed to also create the proper token for convex programatically ๐Ÿ™‚ is this path something that you guys may be interested?
ballingt
ballingtโ€ข4w ago
I'll investigate the other "preview" related issue, but most likely I also did something wrong over there.
This might be a real thing, for users who don't have convex preview deployments enabled (generally free users, but also just if they're off) but do have Vecel/Netlify/Cloudflare/wahtever preview deployments enabled, when I've done this I've used an if statement in shell to not deploy functions if it's a preview and hardcode the prod backend convex url. There are only really two approaches here, using your personal dev deployment for the preview or using the production deployment for the preview. Would be worth adding directions at least to https://docs.convex.dev/production/hosting/vercel#preview-deployments
I am automating the interactions with clerk and vercel trough nodeJS scripts. that's providers config plus env vars and some react code . btw: I managed to also create the proper token for convex programatically
If you post I bet folks would be interested! I'm not quite sure what this means, like a browser automation setup that signs up for accounts?
Sorin
SorinOPโ€ข4w ago
so basically you just skip the convex deploy altogether. corect?
ballingt
ballingtโ€ข4w ago
yeah
Sorin
SorinOPโ€ข4w ago
specifically in vercel we can scope the env vars, so we can prep the env upfront for a clean path I hope to get some time during the we to work on this and I'll post here the results. maybe it saves someone some time ๐Ÿ˜„ >> as in: i'll do a sanity check to see if nothing else was changed, and then put in the if thingy Thanks

Did you find this page helpful?