gulp-imagemin: error "pPipe(...) is not a function"

1.3k views Asked by At

Running gulp-imagemin causes the following error:

/.../node_modules/imagemin/index.js:64
const pipe = opts.plugins.length > 0 ? pPipe(opts.plugins)(input) : Promise.resolve(input);
                                                          ^

TypeError: pPipe(...) is not a function

Source:

import plugins from 'gulp-load-plugins';
...
gulp.task('img:production', () =>
  gulp.src(`${config.dirs.src}/img/**/*`)
  .pipe(plugins().imagemin())
  .pipe(gulp.dest(`${config.dirs.dist}/img`))
);
...
gulp.task('build:production',
  [
   'img:production',
   'html:production',
   'css:production',
   'js:production',
   'copy',
   'critical',
  ],
);
  • Gulp: 3.9.1
  • Gulp-Imagemin: 3.2.0
1

There are 1 answers

0
purii On BEST ANSWER

This seems to be an issue with the current version of gulp-imagemin. But it should be fixed with the upcomming version, according to that issue: https://github.com/sindresorhus/gulp-imagemin/issues/261