RG
RG8h ago

Trouble Creating Preview Deployment

I’m having trouble deploying a Preview Deployment. I am not using Vercel or Netflify. 
Just Convex Cloud for the backend, and the React/Vite frontend is hosted on Cloudflare Pages. I did the following: 1. Created a Preview Deploy key under Project Settings in the dashboard. 2. Set this an env var $CONVEX_DEPLOY_KEY that starts with “preview:” in my terminal. 3. Created a Preview Deployment called staging by running npx convex deploy --preview-create staging --yes (successful) 4. Added the appropriate environment variables to the above deployment including CONVEX_DEPLOY_KEY However, when I run npx convex deploy, I get the error: ✖ npx convex deploy to a preview deployment could not determine the preview name. Provide one using --preview-create It looks similar to this issue: https://discord.com/channels/1019350475847499849/1437462000123908338/1437462000123908338
3 Replies
Convex Bot
Convex Bot8h 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!
ballingt
ballingt8h ago
Are you pushing to the preview deployments from your own machine instead of the Cloudflare build environment? re
Provide one using --preview-create
it sounds like you don't want to use --preview-create because you'd like to push to this same preview deployment? Today preview deployments are single-use: you create and push code to one, then create and push again to a new one; if the same preview create name is used, it replaces the old one It sounds like you might want a staging environment instead? Today the cleanest way to do this is a separate convex project, we're in planning stages for how to have multiple long-lasting deployments in the same project.
RG
RGOP6h ago
Yeah what I want is a staging environment! I thought preview was the same thing If I am to create a new project for a staging environment, what would you recommend be the best way to do this? My goal is to simply have a convex project/env that is linked to my staging branch on github ... with its own env vars. The env var part is easy. but When I run npx convex deploy it deploys to the "production" deployment of production, which is great, but how do I set it up such that it can also deploy to staging project's "production" deployment? something like npx convex deploy --staging

Did you find this page helpful?