Skip to content

Commit c4795e6

Browse files
guybedfordMylesBorins
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 5bd85cb commit c4795e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/modules/cjs/loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ function resolveBasePath(basePath, exts, isMain, trailingSlash, request) {
433433

434434
function trySelf(parentPath, isMain, request) {
435435
const { data: pkg, path: basePath } = readPackageScope(parentPath) || {};
436-
if (!pkg || 'exports' in pkg === false) return false;
436+
if (!pkg || pkg.exports === undefined) return false;
437437
if (typeof pkg.name !== 'string') return false;
438438

439439
let expansion;

0 commit comments

Comments
 (0)