New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error - "Task function must be specified" #54

Closed
yairEO opened this Issue Jan 17, 2016 · 15 comments

Comments

Projects
None yet
8 participants
@yairEO
Copy link

yairEO commented Jan 17, 2016

I've updated my GULP to v4 and i'm getting this error. Here's the log:

C:\xampp\htdocs\project>gulp

assert.js:89
  throw new assert.AssertionError({
  ^
 AssertionError: Task function must be specified
    at Gulp.set [as _setTask] (C:\xampp\htdocs\project\node_modules\gulp\node_modules\undertaker\lib\set-task.js:12:3)
    at Gulp.task (C:\xampp\htdocs\project\node_modules\gulp\node_modules\undertaker\lib\task.js:13:8)
    at Object.<anonymous> (C:\xampp\htdocs\project\gulpfile.js:47:6)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Liftoff.handleArguments (C:\Users\vsync\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:116:3)

@yairEO yairEO closed this Jan 17, 2016

@bradodarb

This comment has been minimized.

Copy link

bradodarb commented Jun 17, 2016

What was the fix @yairEO ?

@yairEO

This comment has been minimized.

Copy link
Author

yairEO commented Jun 17, 2016

@bradodarb - The fix was to go back to v3 :)

@voyti

This comment has been minimized.

Copy link

voyti commented Jun 28, 2016

@yairEO More in-depth analysis would be appreciated, since I'm having the same issue ;)

@phated

This comment has been minimized.

Copy link
Member

phated commented Jun 28, 2016

@voyti there's a great article about upgrading in our docs: https://www.liquidlight.co.uk/blog/article/how-do-i-update-to-gulp-4/

@voyti

This comment has been minimized.

Copy link

voyti commented Jun 28, 2016

@phated All clear, thank you!

@NextSeason

This comment has been minimized.

Copy link

NextSeason commented Dec 23, 2016

I got the same Error Message with a simple task :

gulp.task( 'js', () => {
    return gulp.src( 'src/**/*.js', { buffer : false } )
        .pipe( cached( 'js' ) )
        .pipe( pkg() )
        .pipe( directive() )
        .pipe( gulp.dest( 'output' ) );
} );
@lucien144

This comment has been minimized.

Copy link

lucien144 commented Jan 12, 2017

@NextSeason Have you found a solution? Having the same issue with similar simple task.

@lucien144

This comment has been minimized.

Copy link

lucien144 commented Jan 12, 2017

@NextSeason Ok, just found issue on my side in gulpfile.js with one wrong task definition -> be sure your gulpfile.js is all correct and all your tasks are written correctly!

@yairEO

This comment has been minimized.

Copy link
Author

yairEO commented Jan 12, 2017

I've tried again last night to change to Gulp 4, and again faced an hour of nightmare compatibility issues.
I managed to make it work, except gulp.watch which won't work for some reason and the internet did not present any answer.

@NextSeason

This comment has been minimized.

Copy link

NextSeason commented Jan 12, 2017

@lucien144 I did not find anyway to solve this problem and reversed to V3.

@lucien144

This comment has been minimized.

Copy link

lucien144 commented Jan 12, 2017

@yairEO @NextSeason Guys, can you post here your gulpfile.js so we can check? I've got pretty complex gulpfile.coffee and switch from v3 to v4 was (after some struggling :)) pretty ok.

@NextSeason

This comment has been minimized.

Copy link

NextSeason commented Jan 13, 2017

@lucien144 There are several separate javascript files and some gulp tasks written by myself, every of them might cause this error, so it's too complex to paste all of them here. I don't want to check it again, so I can't waste others' time here to read my code line by line. Maybe I will refactor my code someday If version 3 cannot satisfy my requirement or for some reasons else.

@phated

This comment has been minimized.

Copy link
Member

phated commented Jan 13, 2017

These discussions belong on StackOverflow, not deep in a closed issue ☹️

@ku3mich

This comment has been minimized.

Copy link

ku3mich commented Jul 10, 2017

https://fettblog.eu/gulp-4-parallel-and-series/
because
gulp.task(name, deps, func) was replaced by gulp.task(name, gulp.{series|parallel}(deps, func))

@philipmw

This comment has been minimized.

Copy link

philipmw commented Oct 11, 2017

Thanks. I ran into this problem too, and ku3mich's link solved my problem. This is a documentation problem at this point; https://github.com/gulpjs/gulp/blob/master/docs/API.md is still describing v3's API.

@gulpjs gulpjs locked and limited conversation to collaborators Oct 13, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.