Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db5ec52

Browse filesBrowse 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
Copy full SHA for db5ec52

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: lib/internal/modules/cjs/loader.js
+1-1Lines 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
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.