1

I am doing gulpfile to update css for my site and here is the error, what should I do? Code:

var
 clean = require("del")
 gulp  = require("gulp"),
 livereload = require("gulp-livereload");

gulp.task("reload-css", function() {

 gulp.src('./src/*.css')
 .pipe(reload-css())
 .pipe(gulp.dest('css'))
 .pipe(livereload());
});

gulp.task("default", function() {
 gulp.task('watch', function() {
 livereload.listen();
 gulp.watch('./src/*.css', ['reload-css'])});
});

Using gulpfile D:\DenverServer\home\test1.ru\www\gulpfile.js

[23:03:53] Starting 'default'...
[23:03:53] The following tasks did not complete: default
[23:03:53] Did you forget to signal async completion?
Kresimir
  • 777
  • 5
  • 20
MrDemmy
  • 11
  • 2

1 Answers1

0

@MrDemmy thanks for providing the package version.

You can try this (a promise returning approach)

var clean = require("del")
gulp = require("gulp"),
    livereload = require("gulp-livereload");

gulp.task("reload-css", function () {
    return new Promise(function(resolve, reject) {
        gulp.src('./src/*.css')
        .pipe(gulp.dest('css'))
        .pipe(livereload());
        resolve();
    });
});

gulp.task("default", function () {
    return new Promise(function(resolve, reject) {
        gulp.task('watch', function() {
            livereload.listen();
            gulp.watch('./src/*.css', ['reload-css'])
        });
        resolve();
    });
});

For more information :::> Gulp error: The following tasks did not complete: Did you forget to signal async completion?

Gaurav Mall
  • 500
  • 4
  • 16