{"record":{"id":"2db7711627080235","repo":"medusajs/medusa","slug":"warning-could-not-read-tsconfigbasepath-using","errorCode":null,"errorMessage":"Warning: could not read ${tsconfigBasePath}, using default compiler options","messagePattern":"Warning: could not read (.+?), using default compiler options","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cli/http-types-generator/src/core/program-factory.ts","lineNumber":22,"sourceCode":"import { Config } from \"../config\"\n\nexport interface ProgramContext {\n  program: ts.Program\n  checker: ts.TypeChecker\n}\n\nexport class ProgramFactory {\n  /**\n   * Reads and parses the project's TypeScript compiler options from the\n   * tsconfig file specified in config (defaults to `tsconfig.json`).\n   */\n  private static getBaseCompilerOptions(): ts.CompilerOptions {\n    const projectRoot = FsHelpers.getProjectRoot()\n    const tsconfigBasePath = path.join(projectRoot, Config.get().tsconfig)\n\n    const configStr = ts.sys.readFile(tsconfigBasePath)\n    if (!configStr) {\n      console.warn(\n        `Warning: could not read ${tsconfigBasePath}, using default compiler options`\n      )\n      return {\n        target: ts.ScriptTarget.ES2021,\n        module: ts.ModuleKind.Node16,\n        moduleResolution: ts.ModuleResolutionKind.Node16,\n        esModuleInterop: true,\n        skipLibCheck: true,\n        strictNullChecks: true,\n        resolveJsonModule: true,\n        allowJs: true,\n      }\n    }\n\n    const parsed = ts.parseJsonConfigFileContent(\n      JSON.parse(configStr),\n      ts.sys,\n      projectRoot","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/cli/http-types-generator/src/core/program-factory.ts#L4-L40","documentation":"Before creating the TypeScript program, the http-types-generator reads the tsconfig specified in its config to inherit compiler options (paths, target, jsx...). If the tsconfig file cannot be read (missing or unreadable), it warns and falls back to hardcoded defaults (ES2021, Node16...), which may break path alias resolution.","triggerScenarios":"Config points to a non-existent tsconfig path, e.g. \"tsconfig\": \"tsconfig.json\" when the project uses tsconfig.app.json, or the file lacks read permissions.","commonSituations":"Running the generator from a workspace root where the relative tsconfig path resolves differently; monorepo setups with nested tsconfigs.","solutions":["Set the correct tsconfig path in http-types config: { \"tsconfig\": \"./tsconfig.app.json\" }","Verify the path is relative to the project root detected by FsHelpers.getProjectRoot","Re-run and confirm no warning"],"exampleFix":"// before\n{ \"tsconfig\": \"tsconfig.json\" }\n\n// after\n{ \"tsconfig\": \"./tsconfig.app.json\" }","handlingStrategy":"validation","validationCode":"import { existsSync } from \"fs\"\nconst tsconfig = require(\"./http-types.config.json\").tsconfig ?? \"tsconfig.json\"\nif (!existsSync(tsconfig)) throw new Error(`tsconfig not found: ${tsconfig}`)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Point the http-types config's tsconfig at the file that actually configures your app sources","Verify relative paths resolve from the project root"],"tags":["cli","http-types-generator","tsconfig","compiler-options"],"backgroundTag":"config-file-not-found","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}