diff --git a/src/compiler/program.ts b/src/compiler/program.ts index ec03cfa3f3d..a52ffc85452 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -358,7 +358,7 @@ namespace ts { // load type declarations specified via 'types' argument or implicitly from types/ and node_modules/@types folders const typeReferences: string[] = getAutomaticTypeDirectiveNames(options, host); - if (typeReferences) { + if (typeReferences.length) { // This containingFilename needs to match with the one used in managed-side const containingFilename = combinePaths(host.getCurrentDirectory(), "__inferred type names__.ts"); const resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);