diff --git a/src/compiler/moduleSpecifiers.ts b/src/compiler/moduleSpecifiers.ts index 1913ee90b2b..f5bac45f6ab 100644 --- a/src/compiler/moduleSpecifiers.ts +++ b/src/compiler/moduleSpecifiers.ts @@ -203,7 +203,7 @@ namespace ts.moduleSpecifiers { return; // Don't want to a package to globally import from itself } - const target = targets.find(t => compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === Comparison.EqualTo); + const target = find(targets, t => compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === Comparison.EqualTo); if (target === undefined) return; const relative = getRelativePathFromDirectory(resolved, target, getCanonicalFileName);