webpack-stream: How do you handle errors in broken stream?
I’m trying to use plumber to handle the errors. If compilation fails during watch, plumber keeps the pipe together, but webpack watch zombies out.
var gulp = require('gulp');
var webpack = require('webpack-stream');
var path = require('path');
var plumber = require('gulp-plumber');
gulp.task('webpack-client', function() {
return gulp.src(path.join('app/rehydrate'))
.pipe(plumber())
.pipe(webpack( require(path.join('../..', 'webpack.config.js'))[0] ))
.pipe(gulp.dest(path.join('public/dist')));
});
About this issue
- Original URL
- State: open
- Created 9 years ago
- Comments: 24 (1 by maintainers)
Commits related to this issue
- switch back to webpack-stream, waiting on fixt at https://github.com/shama/webpack-stream/issues/67#issuecomment-175688245 — committed to gkiely/Batch by gkiely 8 years ago
Has someone finally found a workaround to this issue, other than @iliakan solution to use
webpackdirectly?Hi Guys,
I am using the following versions of the libs and can use plumber with default settings as outlined in the first comment in order to not break the stream and the webpack watch feature when a build error occurs:
“webpack”: “^1.12.9” “webpack-stream”: “^3.0.1” “gulp-plumber”: “^1.0.1”
So there is no need anymore for custom error handling
Update: The watch task is still doing its job and every time a new build is made, but after the first error the build will be corrupt, until i restart the whole gulp task, so it’s not working smooth yet 😦
Hi guys, any solution how to solve the problem?
After the error in js, pipe is alive but there is no recompiled file.
This solution is fix the issue https://github.com/shama/webpack-stream/issues/34#issuecomment-177080628
But that’s not the right way to fix.