Search code examples
javascriptgulpgulp-sassgulp-concat

Gulp: Object #<File> has no method 'isNull'


I'm getting TypeError: Object #<File> has no method 'isNull' from both gulp-concat and gulp-sass:

gulp.task('scripts', function() {
    var dest = BUILD_DEST + 'scripts';
    del(dest);

    return gulp
        .src( scripts ) // scripts = [].concat(VENDOR_LIBS, APP_FILES)
        .pipe( plumber() )
        .pipe( concat('script.js') ) // everything is fine when this line is removed
                                     // Does the output file need to already exist?
        .pipe( gulp.dest( dest ) );
});

gulp.task('styles', function() {
    var dest = BUILD_DEST + 'styles';
    del(dest);

    return gulp
        .src( STYLE_FILES ) // STYLE_FILES = APP_SRC+'styles/*.scss'
        .pipe( plumber() )
        .pipe( sass() )
        .pipe(gulp.dest( dest ));
});

Solution

  • This was due to accidentally using an old version of gulp (3.0.0 vs 3.8.10), which was incompatible with gulp-concat and gulp-sass. Upgrading to version 3.8.10 resolved the issue.