OverZealous / run-sequence

Run a series of dependent gulp tasks in order
MIT License
962 stars 61 forks source link

TypeError: gulp.hasTask is not a function #106

Closed Alecto closed 5 years ago

Alecto commented 5 years ago

while I used gulp 3.9.1 - everything was fine. after updating gulp to version 4.0.0, running the run-sequence code causes an error:

[16:21:33] TypeError: gulp.hasTask is not a function at D:\node_modules\run-sequence\index.js:23:22 at Array.forEach () at verifyTaskSets (D:\node_modules\run-sequence\index.js:17:11) at runSequence (D:\node_modules\run-sequence\index.js:130:2) at D:\webProjects\motobratva\my\gulpfile.js:92:3 at taskWrapper (D:\node_modules\undertaker\lib\set-task.js:13:15) at bound (domain.js:396:14) at runBound (domain.js:409:12) at asyncRunner (D:\node_modules\async-done\index.js:55:18) at process._tickCallback (internal/process/next_tick.js:61:11)

Process finished with exit code 1

The task code is as follows: gulp.task('compile', function (callback) { runSequence('comb', 'sass', 'minify', callback); });

Separately, each task works correctly.

OverZealous commented 5 years ago

Hey there! Run-sequence does not support gulp 4.0, which has it's own built-in sequencing functions. This is noted in the README.

Alecto commented 5 years ago

Unfortunately, gulp.series does not allow you to track the end of a task, as the Run-sequence does.

OverZealous commented 5 years ago

That's a shame. You'll have to take this up with the developers of gulp, since run-sequence is built around the internals of gulp 3, and I have no plans to update it to work with gulp 4, which has major changes.

orangecoding commented 5 years ago

You should print a big message in the readme saying that this project is not maintained for gulp 4. as more and more ppl update, this is becoming a blocker for all of those using this plugin.

OverZealous commented 5 years ago

It’s already there, the message has been there almost since gulp 4 was announced years ago.

Nobody reads warnings anyway, making it bigger or whatever won’t help.

jigarhalani commented 4 years ago

any update on this how can we solve this issue?

Alecto commented 4 years ago

just do not use this plugin. gulp 4 already has built-in methods for working with asynchronous and synchronous code: series() and parallel()

andyford commented 2 years ago

anyone landing on this thread might be interested in https://www.npmjs.com/package/gulp4-run-sequence