mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
module: trim off internal stack frames for require(esm) warnings
Trim off irrelevant internal stack frames for require(esm) warnings so it's easier to locate where the call comes from when --trace-warnings is used. PR-URL: https://github.com/nodejs/node/pull/55496 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
This commit is contained in:
parent
4354a1de0e
commit
3b3a95ac0c
4 changed files with 48 additions and 3 deletions
|
@ -1389,7 +1389,10 @@ function loadESMFromCJS(mod, filename) {
|
|||
messagePrefix = `${from} is loading ES Module ${to} using require().\n`;
|
||||
}
|
||||
}
|
||||
emitExperimentalWarning('Support for loading ES Module in require()', messagePrefix);
|
||||
emitExperimentalWarning('Support for loading ES Module in require()',
|
||||
messagePrefix,
|
||||
undefined,
|
||||
parent?.require);
|
||||
const {
|
||||
wrap,
|
||||
namespace,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue