Skip to content

Gulp Watch Task Error #35

@scchengaiah

Description

@scchengaiah

The below mentioned gulp task generates the following error.
Code:
gulp.task("default", gulp.series(['build'], function() { gulp.watch("./src/**/*", ["compress"]); gulp.watch("./src/**/*.js", ["copy:js"]); gulp.watch("./src/**/*.html", ["copy:html"]) }));
Error:
Error: watching ./src/**/*: watch task has to be a function (optionally generated by using gulp.parallel or gulp.series) at Gulp.watch (E:\Activities\Mendix\mendix_workspace\GridSelector-master\node_modules\gulp\index.js:31:11) at E:\Activities\Mendix\mendix_workspace\GridSelector-master\gulpfile.js:47:14 at bound (domain.js:395:14) at runBound (domain.js:408:12) at asyncRunner (E:\Activities\Mendix\mendix_workspace\GridSelector-master\node_modules\async-done\index.js:55:18) at process._tickCallback (internal/process/next_tick.js:61:11)

Fix to Overcome the same - Add Gulp.series calls for all the watch functions.
Code:
gulp.task("watch", gulp.series(['build'], function() { gulp.watch("./src/**/*", gulp.series("compress")); gulp.watch("./src/**/*.js", gulp.series("copy:js")); gulp.watch("./src/**/*.html", gulp.series("copy:html")) }));

If the issue is replicable for all the users, it is better we fix the same

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions