U
U
Uncle Tolya2019-09-06 00:52:23
gulp.js
Uncle Tolya, 2019-09-06 00:52:23

What causes an error in a Gulp task?

Mistake

Error: write callback called multiple times
    at DestroyableTransform.afterTransform (/home/kek/_local/web-starter/node_modules/readable-stream/lib/_stream_transform.js:84:31)
    at EventEmitter.signals.on.err (/home/kek/_local/web-starter/node_modules/gulp-cache/lib/index.js:451:7)
    at EventEmitter.emit (events.js:189:13)

Task
gulp.task('img', () => {
  return gulp.src(paths.input.img + '**/*.{png,jpg,gif,webp}')
    .pipe(cache(imagemin([
      imagemin.gifsicle({
        interlaced: true
      }),
      imagemin.jpegtran({
        progressive: true
      }),
      imageminJpegRecompress({
        loops: 5,
        min: 70,
        max: 75,
        quality: 'medium'
      }),
      imagemin.svgo(),
      imagemin.optipng({
        optimizationLevel: 3
      }),
      pngquant({
        quality: '65-70',
        speed: 5
      }),
      imageminWebp({
        quality: 80,
        preset: 'photo',
        method: 6
      }),
    ])))
    .pipe(gulp.dest(paths.build));
});

I tried googling, but nothing came up.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question