mermM
Convex Community2mo ago
1 reply
merm

LocalDeploymentMismatch after switching Convex accounts

After I switch accounts, I can no longer connect to my local dev server and have to set it up again.
Convex version: 1.31.0

1. Start a local dev server (linking to an existing project) using npx convex dev --configure - working fine.
2. run npx convex logout/npx convex login to switch accounts (and work on another client's project)
3. run npx convex logout / npx convex login to return to the first account
4. run
npx convex dev
to spin up my local server - I get the following error:
✖ Error fetching POST  https://api.convex.dev/api/local_deployment/start 400 Bad Request: LocalDeploymentMismatch: The deployment local-[PROJECT-NAME]-3 does not match the provided device name, or project. 

Note the -3 after the project name in the error message. This number is one less than the number in the label in the environment dropdown list in convex Dashboard - eg "Device name (4)".

Only workaround is to delete convex-backend-state folder and run npx convex dev --configure again.
This sucks because I have to start from scratch every time I switch accounts - (DB seed & environment variables).

I'm using the local dev server because my convex functions are calling a service running locally on my machine.
Was this page helpful?