Skip to content
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

Stops after "Error in plugin 'gulp-postcss' " #42

Open
nerijusgood opened this issue Nov 7, 2015 · 7 comments
Open

Stops after "Error in plugin 'gulp-postcss' " #42

nerijusgood opened this issue Nov 7, 2015 · 7 comments

Comments

@nerijusgood
Copy link

Gulp task:

gulp.task('css', function () {
    var processors = [
        cssnested,
        cssimport,
        csssimplevars,
        cssnext(),
        cssnano
    ];
    return gulp.src('./src/css/main.css')
        .pipe(plumber())
        .pipe(sourcemaps.init())
            .pipe(postcss(processors))
        .pipe(sourcemaps.write('.'))
        .pipe(gulp.dest('./css'))
        .pipe(reload({stream:true}));
});

gulp.task('watch', function() {
    gulp.watch(paths.css, ['css']);
});

Whenever there is an error, like importing file that does not exist (wrong path), I get this error which stops gulp:

[15:31:29] Starting 'css'...
[15:31:29] Plumber found unhandled error:
 Error in plugin 'gulp-postcss'
Message:
    /Users/Nerijus/Sites/Personal/solofront/user/themes/solofront-theme/src/css/main.css:5:1: Failed to find 'base/header' from /Users/Nerijus/Sites/Personal/solofront/user/themes/solofront-theme
    in [
        /Users/Nerijus/Sites/Personal/solofront/user/themes/solofront-theme/src/css
    ]
Details:
    originalMessage: Failed to find 'base/header' from /Users/Nerijus/Sites/Personal/solofront/user/themes/solofront-theme
    in [
        /Users/Nerijus/Sites/Personal/solofront/user/themes/solofront-theme/src/css
    ]
    fileName: /Users/Nerijus/Sites/Personal/solofront/user/themes/solofront-theme/src/css/main.css
    lineNumber: 5
    columnNumber: 1

Really annoying causing me to restart my tasks every time css error is made. Am I doing something wrong?

@msfragala
Copy link

I'm having a similar problem using gulp-postcss, gulp-plumber, and gulp-watch together — task shown below. When the task encounters a CSS error, the task remains open and the error is logged per the warn error handler passed in, so all is good so far. But the build files aren't updated with any changes made to the source files, like fixing the error.

gulp-watch does still continue to log that changes were detected in the source files; they just don't get processed anymore unless I restart the task over again.

gulp.task('styles', function() {
  gulp.src($.css.globs)
    .pipe(watch($.css.watch, {name: 'styles', verbose: true}))
    .pipe(plumber(warn))
    .pipe(postcss(parts))
    .pipe(gulp.dest($.css.dest));
});

@ambethia
Copy link

Has anyone found a solution/workaround for this yet?

@mgol
Copy link

mgol commented Mar 3, 2016

Might be related: #30 (comment)

@armandabric
Copy link

I have the same issue.

@marko-g-stojkovic
Copy link

I have this problem, but nobody resolved it as I see...

@alkorlos
Copy link

Bad fix:
Will work with gulp-notify https://www.npmjs.com/package/gulp-notify
import notify from 'gulp-notify'; and
Instead .pipe(plumber()) insert .pipe(plumber({ errorHandler: notify.onError('Error: <%= error.message %>') }))

I don't know why it works, I found it when I wanted to delete gulp-notify, he has his own problems (with notifications).

@ronilaukkarinen
Copy link

Just notice the same. Solutions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants