Skip to content

Bug: --configure=new overwrites custom convex/tsconfig.json, breaking path aliases #144

@siraj-samsudeen

Description

@siraj-samsudeen

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

  1. Create a project with a custom convex/tsconfig.json containing path aliases:
    {
      "compilerOptions": {
        "paths": {
          "~/*": ["../*"],
          "@cvx/*": ["./*"]
        }
      },
      "include": ["./**/*", "../errors.ts"]
    }
  2. Run npx convex dev --configure=new --once
  3. Observe convex/tsconfig.json is overwritten — paths and custom include entries are gone
  4. 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:

  1. Not overwrite convex/tsconfig.json if it already exists (preferred), or
  2. Merge the CLI defaults with the existing config, preserving custom entries, or
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions