readable-stream
readable-stream copied to clipboard
Is `ERR_MULTIPLE_CALLBACK` missing a `new`?
ERR_MULTIPLE_CALLBACK is an Error subclass (eventually) defined here:
https://github.com/nodejs/readable-stream/blob/a2e9aedf4aeee4a5e4d8efcb175edb67e2817eaa/lib/ours/errors.js#L70-L97
In this line, ERR_MULTIPLE_CALLBACK is called instead of constructed:
https://github.com/nodejs/readable-stream/blob/a2e9aedf4aeee4a5e4d8efcb175edb67e2817eaa/lib/internal/streams/writable.js#L594
I ran into this in a difficult to isolate scenario
Looks like a bug in Node.js: https://github.com/nodejs/node/blob/10c6596f6d7abf7451112e767f8277fcd276d796/lib/internal/streams/writable.js#L879
@Jarred-Sumner would you like to send a PR? We can't do much about the Node.js source, and we should adapt the code in ours/errors.js to be spawned without new.
A test to repro this would be nice.
https://github.com/nodejs/node/pull/52110