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
{{ message }}
Repository navigation
http.ServerResponse is not an instance of stream.Writable? #44188
This means that ServerResponse fulfilling the contract Writable.toWeb.
What do you see instead?
TypeError [ERR_INVALID_ARG_TYPE]: The "streamWritable" argument must be an stream.Writable. Received an instance of ServerResponse
at new NodeError (node:internal/errors:387:5)
at Object.newWritableStreamFromStreamWritable (node:internal/webstreams/adapters:99:11)
at Writable.toWeb (node:internal/streams/writable:926:27)
http.ServerResponse is not an instance of stream.Writable?
Throwing an error here seems to be an expected behavior since http.ServerResponse is an instance of Stream, not stream.Writable. Is this issue a feature request for the following?
Hello, I found out what was going wrong. Our outgoing message defined here does not extend stream.writable. The probelm is that stream.writable has a writable attribute that behaves differently from the OutgoingMessage writabel attribute and this causes test/parallel/test-http-writable-true-after-close.js to fail because it is not writable after it is destroyed. I was wondering if OutgoingMessage.writable should be true when OutgoingMessage.destroyed is true (like the test checks for) or should OutgoingMessage.writable be false when it gets destroyed?
Activity
daeyeon commentedon Aug 14, 2022
Throwing an error here seems to be an expected behavior since
http.ServerResponseis an instance ofStream, notstream.Writable. Is this issue a feature request for the following?sosoba commentedon Aug 17, 2022
It seems that the bug is on @types/node
Of course, the @daeyeon proposition is successful.
ronag commentedon Nov 4, 2022
toWebshould work onOutgoingMessage.daltonna commentedon Nov 9, 2022
Has anyone claimed this issue? I haven't contributed before but I think this would be a good first issue for me as I have some ideas on a fix.
AlexKliger commentedon Nov 12, 2022
Was this issue already assigned? If not, I'd like to try and solve it. Thanks.
cola119 commentedon Nov 20, 2022
go for it :)
zeazad-hub commentedon Nov 29, 2022
Hey, is this issue still open, because I would like to work on it as my first issue.
zeazad-hub commentedon Dec 6, 2022
Hello, I found out what was going wrong. Our outgoing message defined here does not extend stream.writable. The probelm is that stream.writable has a writable attribute that behaves differently from the OutgoingMessage writabel attribute and this causes test/parallel/test-http-writable-true-after-close.js to fail because it is not writable after it is destroyed. I was wondering if OutgoingMessage.writable should be true when OutgoingMessage.destroyed is true (like the test checks for) or should OutgoingMessage.writable be false when it gets destroyed?
http: change OutgoingMessage so that it inherits from stream.Writable…
daeyeon commentedon Dec 9, 2022
@zeazad-hub FWIW, there seems to be a performance issue when trying
OutgoingMessageinheritingstream.Writable.lib: allow Writeable.toWeb() to work on http.Outgoing message
lib: allow Writeable.toWeb() to work on http.Outgoing message
http: change OutgoingMessage so that it inherits from stream.Writable…
node: removed script.sh file that i created previously
lib: allow Writeable.toWeb() to work on http.Outgoing message