Gulp Error : watch task has to be a function

You, Gulp

Error: watching src/**/*.css: watch task has to be a function (optionally generated by using gulp.parallel or gulp.series)

If you have ever come across this error this is due to a gulp version issue,

in gulp 3.x versions we used as follow.'src/**/*.js', ['js']);

But in gulp 4.x you need to pass the task name in a function as follow.'app/**/*.js', gulp.series('js'));

You can read further about gulp.series here.

© Heshan Wanigasooriya.RSS

🍪 This site does not track you.