Handle if reading tsconfig file fails (#37563)

Fixes #36862
This commit is contained in:
Sheetal Nandi
2020-03-25 10:14:31 -07:00
committed by GitHub
parent a1c8608f68
commit b7b2c333a9
2 changed files with 24 additions and 1 deletions

View File

@@ -1974,7 +1974,7 @@ namespace ts.server {
// Read updated contents from disk
const configFilename = normalizePath(project.getConfigFilePath());
const configFileContent = this.host.readFile(configFilename)!; // TODO: GH#18217
const configFileContent = this.host.readFile(configFilename) || "";
const result = parseJsonText(configFilename, configFileContent);
if (!result.endOfFileToken) {