sindresorhus / gulp-imagemin

Minify PNG, JPEG, GIF and SVG images
MIT License
1.9k stars 157 forks source link

7.1.0: npm run build results with TypeError in plugin "gulp-imagemin" when running docker-compose on Apple Silicon device #369

Open karolpawlowski opened 2 years ago

karolpawlowski commented 2 years ago

I'm just trying to run my project on a new laptop with Apple Silicon chip. It is dockerised, so I thought there shouldn't be many problems. I encountered this one with gulp-imagemin in 7.1.0 version when running npm run build:

#31 13.93 [14:19:40] TypeError in plugin "gulp-imagemin"
#31 13.93 Message:
#31 13.93     fn is not a function
#31 13.93 Details:
#31 13.93     fileName: /frontend/app/img/ui/cluster_1.svg
#31 13.93     domainEmitter: [object Object]
#31 13.93     domainThrown: false
#31 13.93 

I solved it by changing version to 8.0.0 but then got this error https://github.com/sindresorhus/gulp-imagemin/issues/366 with require() of ES modules is not supported

Does anyone faced this problem? I think I should stick with 7.1.0 version, but why it doesn't work?

jerryoung commented 2 years ago

I met the trouble like this, too.

ikangjie commented 2 years ago

I met the trouble like this, too.

alienat3d commented 1 year ago

This older version helped me to solve this problem: npm install --save-dev gulp-imagemin@7.1.0