Open
Description
Putting Transform
s created by through2.obj
first when using stream.compose
function (introduced in Node.js 16) with object inputs causes type error, just like putting non-object Transform
s in it does. Nevertheless, putting normal Transform
s created by its constructor first and through2.obj
in the middle works right.
Though using normal Transform
s avoids the problem, as a lot of plugins like in gulp
use through2
internally, it would be nice if this can be fixed.
Node version: v16.17.1
Snippet:
stream.Readable.from([{}])
.pipe(stream.compose(
require('through2').obj((chunk, enc, callback) => callback(null, chunk))
));
The error log:
TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of File
at new NodeError (node:internal/errors:387:5)
at _write (node:internal/streams/writable:314:13)
at ComposeDuplex.Writable.write (node:internal/streams/writable:336:10)
at Readable.ondata (node:internal/streams/readable:754:22)
at Readable.emit (node:events:513:28)
at Readable.emit (node:domain:552:15)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Readable.push (node:internal/streams/readable:228:10)
at Projects\...\node_modules\fork-stream\index.js:51:13
Metadata
Assignees
Labels
No labels