Skip to content

Commit db5ec52

Browse files
guybedfordMylesBorins
authored andcommitted
module: fix check exports issue in cjs module loading
Refs: #31001 (comment) PR-URL: #31427 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 616a4ee commit db5ec52

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎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)