Closed
Description
- Version: v9.11.2, v10.11.0 and v11.1.0
- Platform: x86_64 GNU/Linux
Repro
- save this is
script.js
:
Promise.reject(1);
setTimeout(() => {}, 2000);
- run
node script.js
Expected: the UnhandledPromiseRejection
is reported as soon as it happens; the node.js process
exits after 2 seconds.
Actual: nothing happens for 2 seconds, then the node.js process exits and only then prints UnhandledPromieRejection
.
This works as expected in v8.12.0