Visitar URL original
Error - "Task function must be specified" · Issue #54 · gulpjs/undertaker · GitHub
Skip to content

Error - "Task function must be specified" #54

Closed

Description

@yairEO

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)

Activity

  1. bradodarb commented on Jun 17, 2016

    @bradodarb

    What was the fix @yairEO ?

  2. yairEO commented on Jun 17, 2016

    @yairEO
    Author

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

  3. voyti commented on Jun 28, 2016

    @voyti

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

  4. phated commented on Jun 28, 2016

    @phated
    Member

    @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/

  5. voyti commented on Jun 28, 2016

    @voyti

    @phated All clear, thank you!

  6. NextSeason commented on Dec 23, 2016

    @NextSeason

    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' ) );
    } );
  7. lucien144 commented on Jan 12, 2017

    @lucien144

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

  8. lucien144 commented on Jan 12, 2017

    @lucien144

    @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!

  9. yairEO commented on Jan 12, 2017

    @yairEO
    Author

    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.

  10. NextSeason commented on Jan 12, 2017

    @NextSeason

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

  11. lucien144 commented on Jan 12, 2017

    @lucien144

    @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.

  12. NextSeason commented on Jan 13, 2017

    @NextSeason

    @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.

  13. phated commented on Jan 13, 2017

    @phated
    Member

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

  14. ku3mich commented on Jul 10, 2017

    @ku3mich

    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))

  15. philipmw commented on Oct 11, 2017

    @philipmw

    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.

  16. locked and limited conversation to collaborators on Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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