{"record":{"id":"7e03f21f73c1a258","repo":"appsmithorg/appsmith","slug":"you-have-both-a-tsconfig-json-and-a-jsconfig-json","errorCode":null,"errorMessage":"You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.","messagePattern":"You have both a tsconfig\\.json and a jsconfig\\.json\\. If you are using TypeScript please remove your jsconfig\\.json file\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/client/config/modules.js","lineNumber":100,"sourceCode":"    return {};\n  }\n\n  const baseUrlResolved = path.resolve(paths.appPath, baseUrl);\n\n  if (path.relative(paths.appPath, baseUrlResolved) === \"\") {\n    return {\n      \"^src/(.*)$\": \"<rootDir>/src/$1\",\n    };\n  }\n}\n\nfunction getModules() {\n  // Check if TypeScript is setup\n  const hasTsConfig = fs.existsSync(paths.appTsConfig);\n  const hasJsConfig = fs.existsSync(paths.appJsConfig);\n\n  if (hasTsConfig && hasJsConfig) {\n    throw new Error(\n      \"You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.\",\n    );\n  }\n\n  let config;\n\n  // If there's a tsconfig.json we assume it's a\n  // TypeScript project and set up the config\n  // based on tsconfig.json\n  if (hasTsConfig) {\n    const ts = require(\n      resolve.sync(\"typescript\", {\n        basedir: paths.appNodeModules,\n      }),\n    );\n    config = ts.readConfigFile(paths.appTsConfig, ts.sys.readFile).config;\n    // Otherwise we'll check if there is jsconfig.json\n    // for non TS projects.","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/client/config/modules.js#L82-L118","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before: repo root contains both tsconfig.json and jsconfig.json\n$ git rm jsconfig.json\n// keep tsconfig.json; copy any needed \"paths\" from jsconfig.json into it first","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nif (fs.existsSync('tsconfig.json') && fs.existsSync('jsconfig.json')) {\n  throw new Error('Remove jsconfig.json when tsconfig.json is present.');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["typescript","configuration","build","cjs"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}