Skip to content

Commit

Permalink
fix resolve fail case (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jun 3, 2024
1 parent afdac03 commit d2a4ac2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/trace/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -716,12 +716,12 @@ export class Resolver {
);
else throwExportNotDefined();
} else if (!allDotKeys(pcfg.exports)) {
if (subpath === ".")
return this.finalizeResolve(
this.resolvePackageTarget(pcfg.exports, pkgUrl, cjsEnv, "", false),
parentIsCjs,
pkgUrl
);
if (subpath === ".") {
const url = this.resolvePackageTarget(pcfg.exports, pkgUrl, cjsEnv, "", false);
if (url === null)
throwExportNotDefined();
return this.finalizeResolve(url, parentIsCjs, pkgUrl);
}
else throwExportNotDefined();
} else {
const match = getMapMatch(
Expand Down

0 comments on commit d2a4ac2

Please sign in to comment.