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
TypeError: Cannot read property 'objectMode' of undefined
at new Cloneable (node_modules/cloneable-readable/index.js:13:41)
at Cloneable (node_modules/cloneable-readable/index.js:10:12)
at File.set (index.js:183:13)
at new File (index.js:33:17)
at Context.<anonymous> (test/file.js:173:18)
The documentation is only requiring stream contents to only inherit from Stream:
The contents of the file. If options.contents is a Stream, it is wrapped in a cloneable-readable 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 #133 but it would require a semver major breaking change.
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 #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
.The text was updated successfully, but these errors were encountered: