1000ch / gulp-image

Optimize PNG, JPEG, GIF, SVG images with gulp task.
http://bit.ly/we-should-optimize-images
MIT License
223 stars 23 forks source link

Unhandled Promise Rejection Warning #38

Open insuusvenerati opened 6 years ago

insuusvenerati commented 6 years ago

Hey I'm getting this error when trying to execute the function

gulp.task("image", () => { gulp.src("./site/static/img/*") .pipe(image({ guetzli: true, options: { guetzli: ["--quality", 85] } })) .pipe(gulp.dest("dist/img")); });

Another node module works so I know the directories are correct. The exact error is: (node:10378) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): [object Object] (node:10378) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non -zero exit code. (node:10378) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): [object Object]

rodrigobacelli commented 6 years ago

+1

lucasruy commented 6 years ago

+1

dkimot commented 6 years ago

I'm having the same problem. I forced Node to crash on unhandled promise rejections (https://medium.com/@dtinth/making-unhandled-promise-rejections-crash-the-node-js-process-ffc27cfcc9dd) and I got back this: /usr/src/app/gulpfile.js:26 process.on('unhandledRejection', (up) => { throw up }); ^ Error: spawn /usr/src/app/node_modules/pngquant-bin/vendor/pngquant ENOENT at _errnoException (util.js:1022:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19) at onErrorNT (internal/child_process.js:372:16) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9)

Give it a shot so we can hopefully figure this out.

I'm also running this inside of a Docker container as well.

onezerodigits commented 6 years ago

+1

rvanbaalen commented 6 years ago

Any update on this? I'm currently experiencing this as well by 2/4 PNG's I'm trying to run through gulp-image.

tmccarten commented 6 years ago

Just had this error. Only seems to affect particular images?

j-tap commented 6 years ago

+1 Image png format: (node:19220) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): [object Object] (node:19220) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

AlexMachin1997 commented 6 years ago

Im also experiencing this issue with the latest version installed.

(node:15748) UnhandledPromiseRejectionWarning: Error: spawn C:\Web Development\Yelpcamp\node_modules\mozjpeg\vendor\cjpeg.exe ENOENT
    at notFoundError (C:\Web Development\Yelpcamp\node_modules\execa\node_modules\cross-spawn\lib\enoent.js:11:11)
    at verifyENOENT (C:\Web Development\Yelpcamp\node_modules\execa\node_modules\cross-spawn\lib\enoent.js:46:16)
    at ChildProcess.cp.emit (C:\Web Development\Yelpcamp\node_modules\execa\node_modules\cross-spawn\lib\enoent.js:33:19)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
(node:15748) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:15748) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:15748) UnhandledPromiseRejectionWarning: Error: spawn C:\Web Development\Yelpcamp\node_modules\pngquant-bin\vendor\pngquant.exe ENOENT
    at notFoundError (C:\Web Development\Yelpcamp\node_modules\execa\node_modules\cross-spawn\lib\enoent.js:11:11)
    at verifyENOENT (C:\Web Development\Yelpcamp\node_modules\execa\node_modules\cross-spawn\lib\enoent.js:46:16)
    at ChildProcess.cp.emit (C:\Web Development\Yelpcamp\node_modules\execa\node_modules\cross-spawn\lib\enoent.js:33:19)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
(node:15748) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
AlexMachin1997 commented 6 years ago

This might be the issue..... image

ghost commented 4 years ago

@AlexMachin1997 Your import name and the usage name is not the same.