module: fix ERR_REQUIRE_ESM error for null frames

PR-URL: https://github.com/nodejs/node/pull/39593
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Guy Bedford 2021-07-30 10:36:53 -07:00 committed by Michaël Zasso
parent 6c769ccedf
commit 93bbaa0ce9
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600
2 changed files with 2 additions and 2 deletions

View File

@ -808,7 +808,7 @@ function hideInternalStackFrames(error) {
if (typeof stackFrames === 'object') {
frames = ArrayPrototypeFilter(
stackFrames,
(frm) => !StringPrototypeStartsWith(frm.getFileName(),
(frm) => !StringPrototypeStartsWith(frm.getFileName() || '',
'node:internal')
);
}

View File

@ -1 +1 @@
require('./package-type-module/cjs.js');
eval("require('./package-type-module/cjs.js')");