Skip to content

Commit

Permalink
module: fix check exports issue in cjs module loading
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
guybedford authored and Trott committed Jan 21, 2020
1 parent 343ddff commit c2c3274
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ function resolveBasePath(basePath, exts, isMain, trailingSlash, request) {

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

let expansion;
Expand Down

0 comments on commit c2c3274

Please sign in to comment.