Skip to content

Commit d3bb23b

Browse files
committed
Keeps returning undefined with no default type roots
1 parent 31aeaaa commit d3bb23b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/compiler/moduleNameResolver.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ namespace ts {
306306
const nmTypes = getNodeModulesTypeRoots(currentDirectory, host);
307307
const pnpTypes = getPnpTypeRoots(currentDirectory);
308308

309-
return [...nmTypes, ...pnpTypes];
309+
if (nmTypes.length > 0 || pnpTypes.length > 0) {
310+
return [...nmTypes, ...pnpTypes];
311+
}
310312
}
311313

312314
/**

0 commit comments

Comments
 (0)