imagemin / imagemin-guetzli

imagemin plugin for guetzli https://github.com/google/guetzli
MIT License
81 stars 9 forks source link

Error using with gulp #6

Closed stereobooster closed 7 years ago

stereobooster commented 7 years ago

Can not make it work with gulp. Tried different ways. "gulp": "^3.9.1", node v6.7.0

.pipe($.imagemin([imageminGuetzli()]))
node_modules/stream-combiner2/node_modules/readable-stream/lib/_stream_readable.js:750
  stream.on('end', function () {
         ^

TypeError: stream.on is not a function
    at Readable.wrap (node_modules/stream-combiner2/node_modules/readable-stream/lib/_stream_readable.js:750:10)
    at wrap (node_modules/stream-combiner2/index.js:67:29)
    at combine (node_modules/stream-combiner2/index.js:29:18)
    at Function.module.exports.obj (node_modules/stream-combiner2/index.js:22:10)
    at Imagemin.createStream (node_modules/imagemin/index.js:103:24)
    at Imagemin.run (node_modules/imagemin/index.js:77:20)
    at DestroyableTransform.through.obj.percent (node_modules/gulp-imagemin/index.js:56:12)
    at DestroyableTransform._transform (node_modules/through2-concurrent/through2-concurrent.js:30:15)
    at DestroyableTransform.Transform._read (node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10)
    at DestroyableTransform.Transform._write (node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:147:83)
    at doWrite (node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:345:64)
    at writeOrBuffer (node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:334:5)
    at DestroyableTransform.Writable.write (node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:271:11)
    at write (node_modules/gulp-gm/node_modules/readable-stream/lib/_stream_readable.js:623:24)
    at flow (node_modules/gulp-gm/node_modules/readable-stream/lib/_stream_readable.js:632:7)
    at Transform.pipeOnReadable (node_modules/gulp-gm/node_modules/readable-stream/lib/_stream_readable.js:664:5)
bradbaris commented 7 years ago

What version of imagemin are you using?

stereobooster commented 7 years ago

gulp-imagemin@^2.2.1:
  version "2.4.0"
  resolved "https://registry.yarnpkg.com/gulp-imagemin/-/gulp-imagemin-2.4.0.tgz#f85948a77af532b4115dc9fbfac04af863a758ba"
  dependencies:
    chalk "^1.0.0"
    gulp-util "^3.0.0"
    imagemin "^4.0.0"
    object-assign "^4.0.1"
    plur "^2.0.0"
    pretty-bytes "^2.0.1"
    through2-concurrent "^1.1.0"
bradbaris commented 7 years ago

Try bumping gulp-imagemin to 3.2.0, and imagemin to ^5.0.0.

stereobooster commented 7 years ago

Yes this worked. Thanks a lot!