Skip to content

Commit c2c3274

Browse files
guybedfordTrott
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 343ddff commit c2c3274

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
@@ -435,7 +435,7 @@ function resolveBasePath(basePath, exts, isMain, trailingSlash, request) {
435435

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

441441
let expansion;

0 commit comments

Comments
 (0)