Turborepo cache issue: Convex not deploying into production
I'm hosting my app on vercel. I'm observing that when I merge a feature branch into main and trigger a production build on vercel, convex deploys the changes into the dev environment and not in production (though I've set a
CONVEX_DEPLOY_KEY
for production). Here is the log of the automatically triggered production build:
But if I redeploy manually (from the vercel dashboard), then my changes are properly deployed into production. Here is the log of the manual redeployment:
Is this the way it should work? Should I always manually deploy my changes in production or shouldn't it occur automatically every time when vercel builds for production?2 Replies
Hmm that's pretty surprising (this is not how it should work). To check a few things:
* The
CONVEX_DEPLOY_KEY
looks something like prod:next-butterfly-210|<stuff>
and is not set with a different value elsewhere (e.g. not in a .env
file)
* These logs are both from production vercel deployments? (not dev or preview environment)
* Does your vercel build command call anything convex related aside from npx convex deploy
(no npx convex run
or predev
command)@sshader
1. yes my CONVEX_DEPLOY_KEY which I set in vercel .env variables (production) is of the form
prod:next-butterfly-210|<stuff>
2. These logs are both for production
. The first is after a feature branch merging into main. The second is after manual redeployment
3. My vercel build cmd is npx convex deploy
It is worth noting that this is a monorepo (turbo-repo with nextjs, and expo app).
I'll try to disable cache and see how it works...
After I disabled the (turbo repo) cache, I'm observing that it's deploying in production as expected. I'll observe this behaviour over a few builds before any conclusion