From 3e01546a96d32a7ed88c0fb1cec176ab6de49dd2 Mon Sep 17 00:00:00 2001 From: Michael Arnaldi Date: Wed, 22 Jun 2022 11:45:18 +0000 Subject: [PATCH] chore: fix watch mode crash (TODO investigate watch mode properly) --- src/compiler/tsbuildPublic.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index e7d4d8196e1..b11524d2277 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -1774,8 +1774,8 @@ namespace ts { function hasSameBuildInfo(state: SolutionBuilderState, buildInfoCacheEntry: BuildInfoCacheEntry, seenRefs: Set, resolvedConfig: ParsedCommandLine, resolvedRefPath: ResolvedConfigFilePath) { if (seenRefs.has(resolvedRefPath)) return false; seenRefs.add(resolvedRefPath); - const refBuildInfo = state.buildInfoCache.get(resolvedRefPath)!; - if (refBuildInfo.path === buildInfoCacheEntry.path) return true; + const refBuildInfo = state.buildInfoCache.get(resolvedRefPath); + if (refBuildInfo && refBuildInfo.path === buildInfoCacheEntry.path) return true; if (resolvedConfig.projectReferences) { // Check references