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
stream: pipeTo treats writer transform() method as pipeline transform #63683
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?
hello
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.
Activity
stream: remove transform-writer handling in pipeTo
stream: remove transform-writer handling in pipeTo
stream: remove transform-writer handling in pipeTo