Skip to content
This repository was archived by the owner on Aug 14, 2026. It is now read-only.
This repository was archived by the owner on Aug 14, 2026. It is now read-only.

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

Open

Description

@nerijusgood

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?

Activity

  1. msfragala commented on Nov 8, 2015

    @msfragala

    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));
    });
    
  2. ambethia commented on Feb 19, 2016

    @ambethia

    Has anyone found a solution/workaround for this yet?

  3. mgol commented on Mar 3, 2016

    @mgol

    Might be related: #30 (comment)

  4. armandabric commented on Jan 11, 2017

    @armandabric

    I have the same issue.

  5. marko-g-stojkovic commented on Nov 22, 2017

    @marko-g-stojkovic

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

  6. alkorlos commented on Jan 31, 2021

    @alkorlos

    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).

  7. rollecode commented on May 24, 2021

    @rollecode

    Just notice the same. Solutions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions