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
- If using TypeScript, delete jsconfig.json and keep tsconfig.json as the single source of path config.
- If using plain JavaScript, delete tsconfig.json and keep jsconfig.json.
- Merge any path mappings from the file you are deleting into the surviving config first.
- 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
- Delete jsconfig.json the moment tsconfig.json is added.
- Merge paths from the removed file into the survivor first.
- Add a precommit check that forbids both files coexisting.
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
- Your project's `baseUrl` can only be set to `src` or `node_m
- The NODE_ENV environment variable is required but was not sp
- The certificate "${crtFile}" is invalid.\n${err.message}
- You specified ${type} in your env, but the file "${file}" ca
- Database URL not found. Please check APPSMITH_DB_URL or APPS
AI-assisted analysis of appsmithorg/appsmith@8cd9021c24 (2026-08-12).
Data as JSON: /api/errors/7e03f21f73c1a258.
Report an issue: GitHub.