Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d72abad

Browse files
authoredJan 22, 2025
Fix incorrect module resolution cache query (microsoft#248)
1 parent 07cf37e commit d72abad

File tree

2 files changed

+15
-70
lines changed

2 files changed

+15
-70
lines changed
 

‎internal/compiler/module/resolver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ func (r *resolutionState) tryLoadInputFileForPath(finalPath string, entry string
753753

754754
func (r *resolutionState) loadModuleFromNearestNodeModulesDirectory(typesScopeOnly bool) *resolved {
755755
mode := core.ResolutionModeCommonJS
756-
if r.esmMode {
756+
if r.esmMode || r.conditionMatches("import") {
757757
mode = core.ResolutionModeESM
758758
}
759759
// Do (up to) two passes through node_modules:

0 commit comments

Comments
 (0)
Please sign in to comment.