Skip to content

Commit 4c1e8f2

Browse files
authored
Fix incorrectly added resolution to resolutionsWithOnlyAffectingLocations (#49523)
1 parent dc6a80b commit 4c1e8f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler/resolutionCache.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,9 @@ namespace ts {
709709

710710
function watchAffectingLocationsOfResolution(resolution: ResolutionWithFailedLookupLocations, addToResolutionsWithOnlyAffectingLocations: boolean) {
711711
Debug.assert(!!resolution.refCount);
712-
if (addToResolutionsWithOnlyAffectingLocations) resolutionsWithOnlyAffectingLocations.push(resolution);
713712
const { affectingLocations } = resolution;
713+
if (!affectingLocations.length) return;
714+
if (addToResolutionsWithOnlyAffectingLocations) resolutionsWithOnlyAffectingLocations.push(resolution);
714715
// Watch package json
715716
for (const affectingLocation of affectingLocations) {
716717
createFileWatcherOfAffectingLocation(affectingLocation);

0 commit comments

Comments
 (0)