-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent unhandled exception from being suppressed by Promise #199
Conversation
@sindresorhus @kevva Hope you publish 3.0.2 after merging this PR. |
I'm not comfortable adding this here too without actually knowing why it resolves the issue. Also seems like the problem is fixed in gulp 4: sindresorhus/gulp-autoprefixer#65 (comment) |
@sindresorhus I omitted the detailed PR description because sindresorhus/gulp-autoprefixer@53ad3c2 is your commit and I thought you know how this change fixes #183. I'll update #199 (comment) when I have enough time and interest. |
Please spare a thought for everybody still using Gulp 3! Gulp 4 only came out... well, it's not out yet apparently. |
@@ -76,7 +76,7 @@ module.exports = (plugins, opts) => { | |||
cb(null, file); | |||
}) | |||
.catch(err => { | |||
cb(new gutil.PluginError('gulp-imagemin:', err, {fileName: file.path})); | |||
setImmediate(cb, new gutil.PluginError('gulp-imagemin', err, {fileName: file.path})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a TODO
comment about removing the setImmediate when gulp 4 is targeted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 79 in 9b0b233
// TODO: remove this setImmediate when gulp 4 is targeted |
Nice work 👍 |
Imagemin v5.x uses Promise, so we should have added the same safety net as sindresorhus/gulp-autoprefixer@53ad3c2.
Fixes #183.