gruntjs / grunt-contrib-imagemin

Minify PNG, JPG, GIF and SVG images.
https://gruntjs.com
MIT License
1.21k stars 175 forks source link

pipe.then is not a function in file *.png #381

Closed bitstarr closed 7 years ago

bitstarr commented 7 years ago

Hi, i'm getting the following error:

Running "imagemin:build" (imagemin) task
Warning: TypeError: pipe.then is not a function in file assets/img/app-icon.png Used --force, continuing.
Warning: TypeError: pipe.then is not a function in file assets/img/foto.jpg Used --force, continuing.

with that setup:

imagemin: {
    build: {
        options: {
            use: [mozjpeg()]
        },
        files: [{
            expand: true,
            cwd: '<%=project.img%>',
            src: ['**/*.{png,jpg,gif}'],
            dest: '<%=project.dist.img%>'
        }]
    },
}
"grunt-contrib-imagemin": "*",
"imagemin-mozjpeg": "5.1.0",

I don't know whats wrong. This was working for ages...

jorrit commented 7 years ago

Try to use imagemin-mozjpeg 6.0.0.

kevva commented 7 years ago

Yup, use imagemin-mozjpeg@6.0.0. It's not recommended to use * as version in your dependencies since it can introduce breaking changes.