Closed demurgos closed 6 years ago
Good catch! It definitely needs to be a ReadableStream. require('stream').Stream
is a super old legacy API that points to a version of streams before Readable/Writable/Duplex. The readable-stream
package actually does things a little differently by exporting a ReadableStream as the main export.
The following code throws an error:
(see the stack trace at the bottom of this Travis Job)
The error is caused in
cloneable-readable
when the stream is cloned because it is expected to be a readable stream (with a_readableState
property):The documentation is only requiring stream contents to only inherit from Stream:
Either the documentation should have stronger requirements for streams (readable stream) or the implementation should check that the stream is readable before cloning it. There's also https://github.com/gulpjs/vinyl/issues/133 but it would require a semver major breaking change.
This error was present in older versions of vinyl and was found while migrating away from
gulp-util
ingulp-cssnano
.