Version
26.2.0
Platform
Subsystem
stream
What steps will reproduce the bug?
import{pipeTo,from}from'node:stream/iter';constchunks=[];constwriter={transform(){console.log('BUG: writer.transform() was called');returnnull;},write(chunk){chunks.push(newTextDecoder().decode(chunk));},};awaitpipeTo(from('hello'),writer);console.log(chunks.join(''));How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
The final pipeTo() argument should be treated only as the destination writer; transform objects are only the arguments before the writer.
What do you see instead?
BUG: writer.transform() was callednode:internal/streams/iter/pull:584 for await (const item of output) { ^TypeError: Cannot read properties of null (reading 'Symbol(Symbol.asyncIterator)') at applyStatefulAsyncTransform (node:internal/streams/iter/pull:584:28) at applyStatefulAsyncTransform.next (<anonymous>) at createAsyncPipeline (node:internal/streams/iter/pull:703:22) at createAsyncPipeline.next (<anonymous>) at pipeTo (node:internal/streams/iter/pull:1000:26) at file:///Users/trivikram/workspace/test-repro/repro.js:15:7 at ModuleJob.run (node:internal/modules/esm/module_job:439:25) at process.processTicksAndRejections (node:internal/process/task_queues:104:5) at async node:internal/modules/esm/loader:646:26 at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)pipeTo() calls writer.transform() when the destination writer object also has a transform() method, so the writer is treated as a transform as well as the destination.
Additional information
No response
Version
26.2.0
Platform
Subsystem
stream
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
helloThe final
pipeTo()argument should be treated only as the destination writer; transform objects are only the arguments before the writer.What do you see instead?
pipeTo()callswriter.transform()when the destination writer object also has atransform()method, so the writer is treated as a transform as well as the destination.Additional information
No response