Skip to content

Commit 624ed0e

Browse files
guybedfordBethGriggs
authored andcommitted
module: fix check exports issue in cjs module loading
Refs: #31001 (comment) PR-URL: #31427 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Shelley Vohr <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 60490f4 commit 624ed0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎lib/internal/modules/cjs/loader.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ function resolveBasePath(basePath, exts, isMain, trailingSlash, request){
433433

434434
functiontrySelf(parentPath,isMain,request){
435435
const{data: pkg,path: basePath}=readPackageScope(parentPath)||{};
436-
if(!pkg||'exports'inpkg===false)returnfalse;
436+
if(!pkg||pkg.exports===undefined)returnfalse;
437437
if(typeofpkg.name!=='string')returnfalse;
438438

439439
letexpansion;

0 commit comments

Comments
(0)