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
<html>
<head></head>
<body>
foo
bar
</body>
</html>
file:///Users/j/playground/unified-stream-bug/node_modules/unified-stream/index.js:49
throw new Error('Did not expect `write` after `end`')
^
Error: Did not expect `write` after `end`
at write (file:///Users/j/playground/unified-stream-bug/node_modules/unified-stream/index.js:49:17)
at EventEmitter.end (file:///Users/j/playground/unified-stream-bug/node_modules/unified-stream/index.js:90:9)
at Socket.<anonymous> (node:internal/streams/pipeline:364:11)
at Object.onceWrapper (node:events:627:28)
at Socket.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Node.js v19.4.0
Expected behavior
As unified-stream (claims to?) returns a duplex Node stream, I would expect to be able to use it in combination with stream.pipeline().
Actual behavior
It fails with an error, see the reproduction steps.
It looks like this: nodejs/node#46205.
Apparently there was a bug with Node calling end twice in 17.3+. I also can repro it on 18.2. It seems fixed in 19.5. I also see that it was backported to at least 18.16 (maybe earlier)?
I think it’s a clear bug in Node. Adding a workaround here for calling end twice to not throw, seems like it might silence more bugs.
So: recommend you update your engines! :)
Initial checklist
Affected packages and versions
unified-stream@9, unified-stream@10
Link to runnable example
No response
Steps to reproduce
Expected behavior
As
unified-stream
(claims to?) returns a duplex Node stream, I would expect to be able to use it in combination withstream.pipeline()
.Actual behavior
It fails with an error, see the reproduction steps.
Affected runtime and version
[email protected]
Affected package manager and version
No response
Affected OS and version
No response
Build and bundle tools
No response
The text was updated successfully, but these errors were encountered: