We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This only happens with readable-stream@4 and Node.js 12. Later versions of Node, or earlier versions of readable-stream, work fine.
readable-stream@4
readable-stream
'use strict' const net = require('net') const { pipeline, PassThrough } = require('readable-stream') const server = net.createServer(function (sock) { pipeline(sock, new PassThrough(), sock, function () { }) }) server.listen(3000, function () { const sock = net.connect(3000) // Change to false to avoid error if (true) { pipeline(sock, new PassThrough(), sock, (err) => { // NodeError: Premature close if (err) throw err }) } else { sock.on('connect', function () { console.log('client connected') pipeline(sock, new PassThrough(), sock, (err) => { if (err) throw err }) }) } })
The text was updated successfully, but these errors were encountered:
duplexify
Happens because sock.readable is initially false (before connect has been emitted) and this branch is hit:
sock.readable
connect
readable-stream/lib/internal/streams/end-of-stream.js
Lines 192 to 197 in 49a45a9
Which evaluates to:
if ( !false && (!false || true) && (false || false === false) ) { process.nextTick(onclose) }
Sorry, something went wrong.
I'm not sure what can we do about this.
No branches or pull requests
This only happens with
readable-stream@4
and Node.js 12. Later versions of Node, or earlier versions ofreadable-stream
, work fine.The text was updated successfully, but these errors were encountered: