Skip to content

Commit

Permalink
module: fix ERR_REQUIRE_ESM error for null frames
Browse files Browse the repository at this point in the history
PR-URL: #39593
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
guybedford authored and targos committed Aug 2, 2021
1 parent 6c769cc commit 93bbaa0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ function hideInternalStackFrames(error) {
if (typeof stackFrames === 'object') {
frames = ArrayPrototypeFilter(
stackFrames,
(frm) => !StringPrototypeStartsWith(frm.getFileName(),
(frm) => !StringPrototypeStartsWith(frm.getFileName() || '',
'node:internal')
);
}
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/es-modules/cjs-esm.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require('./package-type-module/cjs.js');
eval("require('./package-type-module/cjs.js')");

0 comments on commit 93bbaa0

Please sign in to comment.