Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing failed lookup locations when resolving bare-specifier package.json "imports" #60924

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/compiler/moduleNameResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2756,6 +2756,11 @@ function getLoadModuleFromTargetExportOrImport(extensions: Extensions, state: Mo
traceIfEnabled(state, Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup);
traceIfEnabled(state, Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/");
const result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, extensions, /*isConfigLookup*/ false, redirectedReference, state.conditions);
// Note: we cannot safely reassign `state.failedLookupLocations` during a request;
// `nodeModuleNameResolverWorker` relies on the `state` property remaining reference-equal
// to the one it initializes.
state.failedLookupLocations?.push(...result.failedLookupLocations ?? emptyArray);
state.affectingLocations?.push(...result.affectingLocations ?? emptyArray);
return toSearchResult(
result.resolvedModule ? {
path: result.resolvedModule.resolvedFileName,
Expand Down
Loading
Loading