Skip to content

Commit 0a21bf7

Browse files
committed
Prevents crash when the cwd is a relative path
1 parent ae1a967 commit 0a21bf7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/compiler/moduleNameResolver.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ namespace ts {
284284
return [];
285285
}
286286

287+
// Some TS consumers pass relative paths that aren't normalized
288+
currentDirectory = ts.sys.resolvePath(currentDirectory);
289+
287290
const pnpapi = getPnpApi();
288291
const locator = pnpapi.findPackageLocator(`${currentDirectory}/`);
289292
const {packageDependencies} = pnpapi.getPackageInformation(locator);

0 commit comments

Comments
 (0)