diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 1e95c82722..0f0cdc0e11 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -6794,6 +6794,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi specifier = (declaration as ImportDeclaration|ExportDeclaration).moduleSpecifier; } let moduleSymbol = resolver.getSymbolAtLocation(specifier); + if (!moduleSymbol) { + return; + } let moduleDeclaration = getDeclarationOfKind(moduleSymbol, SyntaxKind.SourceFile) as SourceFile; if (!moduleDeclaration || isDeclarationFile(moduleDeclaration)) { return;