diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index c1d361379a6..fd9cf539fc3 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -2842,7 +2842,7 @@ export function classicNameResolver(moduleName: string, containingFile: string, // No originalPath because classic resolution doesn't resolve realPath return createResolvedModuleWithFailedLookupLocations( resolved && resolved.value, - /*isExternalLibraryImport*/ false, + resolved?.value && pathContainsNodeModules(resolved.value.path), failedLookupLocations, affectingLocations, diagnostics,