Bug Description
Running npx convex dev --configure=new --once on an existing project overwrites convex/tsconfig.json with the CLI's default template, stripping any custom paths, include, or other compiler options the project has configured.
This causes all imports using path aliases to fail with esbuild bundler errors.
Steps to Reproduce
- Create a project with a custom
convex/tsconfig.json containing path aliases:
{
"compilerOptions": {
"paths": {
"~/*": ["../*"],
"@cvx/*": ["./*"]
}
},
"include": ["./**/*", "../errors.ts"]
}
- Run
npx convex dev --configure=new --once
- Observe
convex/tsconfig.json is overwritten — paths and custom include entries are gone
- Bundling fails with ~40 "Could not resolve" errors
Error Output (truncated)
✘ [ERROR] Could not resolve "@cvx/_generated/server"
convex/uploads/mutations.ts:1:25
✘ [ERROR] Could not resolve "@cvx/auth"
convex/uploads/mutations.ts:2:21
✘ [ERROR] Could not resolve "~/errors"
convex/email/index.ts:2:23
Expected Behavior
--configure=new should either:
- Not overwrite
convex/tsconfig.json if it already exists (preferred), or
- Merge the CLI defaults with the existing config, preserving custom entries, or
- At minimum, warn that the file will be overwritten and prompt for confirmation
Workaround
Run git restore convex/tsconfig.json after the configure command to recover the custom config.
Environment
- Convex CLI: 1.32.0 (also reproducible on 1.34.0)
- Node.js: 22
- OS: macOS
Additional files overwritten
The --configure=new flag also overwrites these files with CLI defaults:
convex/_generated/api.js
convex/_generated/server.d.ts
convex/_generated/server.js
convex/README.md
The _generated files are less of an issue since they get regenerated on next push, but convex/tsconfig.json contains user configuration that shouldn't be silently replaced.
Bug Description
Running
npx convex dev --configure=new --onceon an existing project overwritesconvex/tsconfig.jsonwith the CLI's default template, stripping any custompaths,include, or other compiler options the project has configured.This causes all imports using path aliases to fail with esbuild bundler errors.
Steps to Reproduce
convex/tsconfig.jsoncontaining path aliases:{ "compilerOptions": { "paths": { "~/*": ["../*"], "@cvx/*": ["./*"] } }, "include": ["./**/*", "../errors.ts"] }npx convex dev --configure=new --onceconvex/tsconfig.jsonis overwritten —pathsand customincludeentries are goneError Output (truncated)
Expected Behavior
--configure=newshould either:convex/tsconfig.jsonif it already exists (preferred), orWorkaround
Run
git restore convex/tsconfig.jsonafter the configure command to recover the custom config.Environment
Additional files overwritten
The
--configure=newflag also overwrites these files with CLI defaults:convex/_generated/api.jsconvex/_generated/server.d.tsconvex/_generated/server.jsconvex/README.mdThe
_generatedfiles are less of an issue since they get regenerated on next push, butconvex/tsconfig.jsoncontains user configuration that shouldn't be silently replaced.