Version
v16.13.1
Platform
mac os 10.14.6, Darwin uladzislaus-mbp 18.7.0 Darwin Kernel Version 18.7.0: Sun Dec 1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64 x86_64
Subsystem
No response
What steps will reproduce the bug?
- create a script file with contents:
process.on('uncaughtException', (_, origin) => {
console.log('whoops, uncaughtException', origin)
})
unknownFunction()
- run
node <name-of-the-file>
- you will see
whoops, uncaughtException uncaughtException
- now, create a
package.json file next to script file with contents:
- run
node <name-of-the-file>
- now, the message will be
whoops, uncaughtException unhandledRejection
How often does it reproduce? Is there a required condition?
In package.json file, type should be module to see the bug.
What is the expected behavior?
uncaughtException origin should be uncaughtException
What do you see instead?
uncaughtException origin is unhandledRejection
Additional information
No response