{"record":{"id":"9cce82bb6691513c","repo":"angular/components","slug":"formatdiagnostics-errors-filesystem","errorCode":null,"errorMessage":"formatDiagnostics(errors, fileSystem)","messagePattern":"formatDiagnostics\\(errors, fileSystem\\)","errorType":"exception","errorClass":"TsconfigParseError","httpStatus":null,"severity":"error","filePath":"src/cdk/schematics/update-tool/utils/parse-tsconfig.ts","lineNumber":56,"sourceCode":"\n  // If there is a config reading error, we never attempt to parse the config.\n  if (error) {\n    throw new TsconfigParseError(formatDiagnostics([error], fileSystem));\n  }\n\n  const parsed = ts.parseJsonConfigFileContent(\n    config,\n    new FileSystemHost(fileSystem),\n    dirname(tsconfigPath),\n    {},\n  );\n\n  // Skip the \"No inputs found...\" error since we don't want to interrupt the migration if a\n  // tsconfig doesn't match a file. This will result in an empty `Program` which is still valid.\n  const errors = parsed.errors.filter(diag => diag.code !== NO_INPUTS_ERROR_CODE);\n\n  if (errors.length) {\n    throw new TsconfigParseError(formatDiagnostics(errors, fileSystem));\n  }\n\n  return parsed;\n}\n","sourceCodeStart":38,"sourceCodeEnd":61,"githubUrl":"https://github.com/angular/components/blob/0411926e7d8ae06b32236ec1048a888cfad5abf2/src/cdk/schematics/update-tool/utils/parse-tsconfig.ts#L38-L61","documentation":"After ts.parseJsonConfigFileContent succeeds structurally, any semantic configuration errors remain in parsed.errors. The tool filters out the benign 'No inputs found' (code 18003) and throws TsconfigParseError with formatted diagnostics for anything else — meaning the tsconfig content itself is invalid (bad compiler options, invalid extends, wrong target, etc.).","triggerScenarios":"parseTsconfigFile's parsed.errors array (excluding code 18003) is non-empty — e.g. unknown compilerOptions keys, invalid option values, unresolvable 'extends' targets, or malformed files/include patterns other than the no-inputs case.","commonSituations":"Upgrading TypeScript/angular versions makes an old option invalid, a typo like 'compilerOption', an extends path pointing to a deleted file, or an include/exclude glob referencing an invalid location.","solutions":["Read the diagnostic in the error message and fix the offending tsconfig option or value it names.","Remove or correct unknown/renamed compilerOptions (check the TypeScript version's valid options).","Fix the 'extends' path so it resolves to an existing tsconfig file.","Validate the file with `tsc --showConfig` (or `tsc -p <file> --noEmit`) to see the same errors outside the migration."],"exampleFix":"// before\n{\n  \"compilerOptions\": {\n    \"strictTyps\": true\n  }\n}\n// after\n{\n  \"compilerOptions\": {\n    \"strict\": true\n  }\n}","handlingStrategy":"try-catch","validationCode":"import {execSync} from 'child_process';\ntry {\n  execSync(`tsc -p ${tsconfigPath} --noEmit --skipLibCheck`, {stdio: 'ignore'});\n} catch {\n  console.error(`tsconfig at ${tsconfigPath} has invalid options; run tsc -p ${tsconfigPath} --noEmit to see them`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  const parsed = parseTsconfigFile(path, fileSystem);\n} catch (e) {\n  if (e instanceof TsconfigParseError) {\n    // message contains formatted TS diagnostics naming the bad options\n    console.error('Fix tsconfig errors reported below:\\n' + e.message);\n  } else {\n    throw e;\n  }\n}","preventionTips":["Run `tsc --showConfig -p tsconfig.json` after editing compiler options.","Remove options dropped by your TypeScript version when upgrading.","Keep `extends` targets within the repo and committed."],"tags":["typescript","tsconfig","diagnostics","configuration"],"backgroundTag":"tsconfig-parse-failed","analyzedSha":"0411926e7d8ae06b32236ec1048a888cfad5abf2","analyzedAt":"2026-08-31T11:58:23.400Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}