From 19f829a54444cc2fbd05c996e03232c3b863bced Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 22 Jul 2019 10:57:34 -0700 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20fail=20when=20alias=20isn?= =?UTF-8?q?=E2=80=99t=20found?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/completions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/completions.ts b/src/services/completions.ts index d7aa66bdf4c..929890ba7e7 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1359,7 +1359,9 @@ namespace ts.Completions { if (isExportStarFromReExport || some(symbol.declarations, d => isExportSpecifier(d) && !d.propertyName && !!d.parent.parent.moduleSpecifier)) { // Walk the export chain back one module (step 1 or 2 in diagrammed example). // Or, in the case of `export * from "foo"`, `symbol` already points to the original export, so just use that. - const nearestExportSymbolId = getSymbolId(isExportStarFromReExport ? symbol : Debug.assertDefined(getNearestExportSymbol(symbol))); + const nearestExportSymbol = isExportStarFromReExport ? symbol : getNearestExportSymbol(symbol); + if (!nearestExportSymbol) continue; + const nearestExportSymbolId = getSymbolId(nearestExportSymbol); const symbolHasBeenSeen = !!symbolToOriginInfoMap[nearestExportSymbolId] || aliasesToAlreadyIncludedSymbols.has(nearestExportSymbolId.toString()); if (!symbolHasBeenSeen) { aliasesToReturnIfOriginalsAreMissing.set(nearestExportSymbolId.toString(), { alias: symbol, moduleSymbol });