appsmithorg/appsmith · error · Error

You have both a tsconfig.json and a jsconfig.json. If you ar

Error message

You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.

What it means

Thrown by getModules() in config/modules.js. It checks for the existence of both tsconfig.json and jsconfig.json; if both are present it throws because the two would compete to define path/alias resolution for the editor and the bundler. CRA picks tsconfig.json when TypeScript is in use and treats jsconfig.json as the JS-only fallback, so having both is ambiguous.

Source

Thrown at app/client/config/modules.js:100

    return {};
  }

  const baseUrlResolved = path.resolve(paths.appPath, baseUrl);

  if (path.relative(paths.appPath, baseUrlResolved) === "") {
    return {
      "^src/(.*)$": "<rootDir>/src/$1",
    };
  }
}

function getModules() {
  // Check if TypeScript is setup
  const hasTsConfig = fs.existsSync(paths.appTsConfig);
  const hasJsConfig = fs.existsSync(paths.appJsConfig);

  if (hasTsConfig && hasJsConfig) {
    throw new Error(
      "You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.",
    );
  }

  let config;

  // If there's a tsconfig.json we assume it's a
  // TypeScript project and set up the config
  // based on tsconfig.json
  if (hasTsConfig) {
    const ts = require(
      resolve.sync("typescript", {
        basedir: paths.appNodeModules,
      }),
    );
    config = ts.readConfigFile(paths.appTsConfig, ts.sys.readFile).config;
    // Otherwise we'll check if there is jsconfig.json
    // for non TS projects.

View on GitHub (pinned to 8cd9021c24)

Solutions

  1. If using TypeScript, delete jsconfig.json and keep tsconfig.json as the single source of path config.
  2. If using plain JavaScript, delete tsconfig.json and keep jsconfig.json.
  3. Merge any path mappings from the file you are deleting into the surviving config first.
  4. Commit the deletion so IDEs and CI agree on a single config.

Example fix

// before: repo root contains both tsconfig.json and jsconfig.json
$ git rm jsconfig.json
// keep tsconfig.json; copy any needed "paths" from jsconfig.json into it first
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
if (fs.existsSync('tsconfig.json') && fs.existsSync('jsconfig.json')) {
  throw new Error('Remove jsconfig.json when tsconfig.json is present.');
}

Prevention

When it happens

Trigger: A project that added TypeScript (creating tsconfig.json) but left a pre-existing jsconfig.json in place, or a tool/IDE that auto-generated one of the two.

Common situations: Migrating a JS project to TS: tsconfig.json is added during setup but jsconfig.json is not removed; VS Code generating a jsconfig.json for a JS workspace that later adopts TS; monorepo templates shipping both.

Related errors


AI-assisted analysis of appsmithorg/appsmith@8cd9021c24 (2026-08-12). Data as JSON: /api/errors/7e03f21f73c1a258. Report an issue: GitHub.