convex-js icon indicating copy to clipboard operation
convex-js copied to clipboard

[Suggestion] Don't Delete convex.json When Running npx convex dev

Open Luzefiru opened this issue 1 year ago • 1 comments

Background Information

I'm developing a project within a team wherein our React client consumes the Convex API. As of the moment, the onboarding process and development environment setup is quite cumbersome due to unintended(?) actions caused by npx convex dev.

We have a client/convex.json file that specifies the following information that is crucial to the functionality of the client side:

{
    "functions": "./src/_convex"
}

Running npx convex dev and going through the setup wizard deletes this file and then results in a [CONVEX Q(files:getFilesByDocumentId)] Could not find public function for 'files:getFilesByDocumentId'. Did you forget to run `npx convex dev` or `npx convex deploy`? error.

Demo

demo

The Suggestion

If it's possible, npx convex dev shouldn't delete these configuration files on directories without .env.local's Convex files. Or perhaps, the wizard can ask questions if there is an existing configuration files or if there are files to ignore during the initialization process.

Also, an npx convex dev --verbose flag would be nice to see explicit updates on any file changes.

Luzefiru avatar Dec 21 '23 03:12 Luzefiru

@Luzefiru that sounds like a bug. We'll look into it. Meanwhile make sure you are on the latest version of convex, as the issue might have already been fixed.

xixixao avatar Jan 18 '24 01:01 xixixao

I think this was fixed a while ago, testing with 1.13.1 it is no longer an issue.

thomasballinger avatar Jul 17 '24 23:07 thomasballinger