TondiT
Convex Community12mo ago
27 replies
Tondi

Running "npx convex deploy --cmd 'next build'" command fails the build

Help me.
I want to deploy to prod. I'm using vercel.
I did the configuration like in the docs by setting CONVEX_DEPLOY_KEY env var only for prod.
But now getting this error in logs:
✖ Vercel build environment detected but CONVEX_DEPLOY_KEY is not set. Set this environment variable to deploy from this environment. See https://docs.convex.dev/production/hosting
Error: Command "npx convex deploy --cmd 'next build'" exited with 1.

And if I set an empty string for previews/development environment for CONVEX_DEPLOY_KEY, I get this:
✖ Detected a non-production build environment and "CONVEX_DEPLOY_KEY" for a production Convex deployment.

I'm stuck.
Share your Convex backend and web app with the world.
Hosting and Deployment | Convex Developer Hub
Was this page helpful?