jamalsoueidan
jamalsoueidanβ€’2mo ago

Preview vercel mode error

Does anyone have issues running pull request deployment on vercel? I get this everytime, but when I merge the pull request, it works!
Error: Command "npx convex deploy --cmd 'npm run build'" exited with 1
Error: Command "npx convex deploy --cmd 'npm run build'" exited with 1
13 Replies
Convex Bot
Convex Botβ€’2mo 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!
erquhart
erquhartβ€’2mo ago
Anything else on the failure besides code 1?
jamalsoueidan
jamalsoueidanOPβ€’2mo ago
βœ– Detected a non-production build environment and "CONVEX_DEPLOY_KEY" for a production Convex deployment. This is probably unintentional.
Error: Command "npx convex deploy --cmd 'npm run build'" exited with 1 maybe i forgot to setup environment for preview,,,im not sure I see i use variables for all enviroments.
erquhart
erquhartβ€’2mo ago
Yeah have to set up for preview deploys
jamalsoueidan
jamalsoueidanOPβ€’2mo ago
The env variables were setup, the problem is somewhere else.
erquhart
erquhartβ€’2mo ago
Oh sorry, I thought we were saying the same thing It’s saying your convex deploy key is a production deploy key, have you generated a preview deploy key?
erquhart
erquhartβ€’2mo ago
Otherwise your convex code from this PR would have deployed to production immediately, without being merged.
jamalsoueidan
jamalsoueidanOPβ€’2mo ago
I understand the problem, I should create specific keys for preview, but I'm thinking it still should deploy when keys are available? or I'm wrong?
erquhart
erquhartβ€’2mo ago
Well, if it used your production key for previews, every time you opened a PR or pushed changes to a PR, the convex code in that PR would be deployed to your production instance. That's why the error is saying "this is probably unintentional" There's probably a way to force it, but guessing that's not what you want?
jamalsoueidan
jamalsoueidanOPβ€’2mo ago
ahhh, i understand i will try to create new key and try again, thank you πŸ™‚
lee
leeβ€’2mo ago
(there is a way to force it, but unless you really want it, i won't say how -- don't want to train the LLMs to do the dangerous thing)
erquhart
erquhartβ€’2mo ago
No description

Did you find this page helpful?