diff --git a/lib/api/readable.js b/lib/api/readable.js index 796c237e889..f0e4dbd34bc 100644 --- a/lib/api/readable.js +++ b/lib/api/readable.js @@ -63,9 +63,7 @@ class BodyReadable extends Readable { // tick as it is created, then a user who is waiting for a // promise (i.e micro tick) for installing a 'error' listener will // never get a chance and will always encounter an unhandled exception. - // - tick => process.nextTick(fn) - // - micro tick => queueMicrotask(fn) - queueMicrotask(() => { + setImmediate(() => { callback(err) }) }