You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ServerResponse doesn't invoke error callbacks when an object is received from the source stream.
Version: 12.18.3
Platform: Linux user 5.4.0-42-generic Tracking / Assuring Compatibility #46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Subsystem: streams, http
What steps will reproduce the bug?
pipe an object from source stream to ServerResponse
const server = http.createServer((req, res) => {
const stream = new Readable({
objectMode: true,
read() {
this.push({ a: "b" });
this.push(null);
},
});
stream.on("error", (e) => console.log("Error in stream"));
res.on("error", (e) => console.log("Error in response stream"));
stream.pipe(res);
// server crashes and error handlers are not called
});
server.listen(3000);
How often does it reproduce? Is there a required condition?
pipe an object from source stream to ServerResponse
What is the expected behavior?
error callbacks attached to res should be called.
What do you see instead?
Process crashes with the following error
_http_outgoing.js:653
throw new ERR_INVALID_ARG_TYPE('first argument',
^
TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer. Received an instance of Object
at write_ (_http_outgoing.js:653:11)
at ServerResponse.write (_http_outgoing.js:621:15)
at Readable.ondata (_stream_readable.js:716:22)
at Readable.emit (events.js:315:20)
at Readable.read (_stream_readable.js:505:10)
at flow (stream_readable.js:1005:34)
at resume (_stream_readable.js:986:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'ERR_INVALID_ARG_TYPE'
}
The text was updated successfully, but these errors were encountered:
ServerResponse doesn't invoke error callbacks when an object is received from the source stream.
What steps will reproduce the bug?
pipe an object from source stream to ServerResponse
How often does it reproduce? Is there a required condition?
pipe an object from source stream to ServerResponse
What is the expected behavior?
error callbacks attached to
res
should be called.What do you see instead?
Process crashes with the following error
_http_outgoing.js:653
throw new ERR_INVALID_ARG_TYPE('first argument',
^
TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer. Received an instance of Object
at write_ (_http_outgoing.js:653:11)
at ServerResponse.write (_http_outgoing.js:621:15)
at Readable.ondata (_stream_readable.js:716:22)
at Readable.emit (events.js:315:20)
at Readable.read (_stream_readable.js:505:10)
at flow (stream_readable.js:1005:34)
at resume (_stream_readable.js:986:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'ERR_INVALID_ARG_TYPE'
}
The text was updated successfully, but these errors were encountered: