Skip to content

Commit 93bbaa0

Browse files
guybedfordtargos
authored andcommitted
module: fix ERR_REQUIRE_ESM error for null frames
PR-URL: #39593 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 6c769cc commit 93bbaa0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/internal/errors.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ function hideInternalStackFrames(error) {
808808
if (typeof stackFrames === 'object') {
809809
frames = ArrayPrototypeFilter(
810810
stackFrames,
811-
(frm) => !StringPrototypeStartsWith(frm.getFileName(),
811+
(frm) => !StringPrototypeStartsWith(frm.getFileName() || '',
812812
'node:internal')
813813
);
814814
}

test/fixtures/es-modules/cjs-esm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
require('./package-type-module/cjs.js');
1+
eval("require('./package-type-module/cjs.js')");

0 commit comments

Comments
 (0)