Async: TypeError: wrapAsync(...) is not a function with node 8.0.0

Created on 11 Jun 2017  ·  9Comments  ·  Source: caolan/async

What version of async are you using?

2.4.1

Which environment did the issue occur in (Node version/browser version)

node 8.0.0

What did you do? Please include a minimal reproducable case illustrating issue.

async=require('async')
_=require('underscore')
async.parallel(_.range(10), function(iter, cb) { cb(null); }, function(err) { console.log(err); })

What did you expect to happen?

should print null.

What was the actual result?

TypeError: wrapAsync(...) is not a function
    at /usr/local/lib/node_modules/async/dist/async.js:3830:24
    at eachOfArrayLike (/usr/local/lib/node_modules/async/dist/async.js:1003:9)
    at eachOf (/usr/local/lib/node_modules/async/dist/async.js:1051:5)
    at _parallel (/usr/local/lib/node_modules/async/dist/async.js:3829:5)
    at Object.parallelLimit [as parallel] (/usr/local/lib/node_modules/async/dist/async.js:3912:5)
    at repl:1:7
    at ContextifyScript.Script.runInThisContext (vm.js:44:33)
    at REPLServer.defaultEval (repl.js:239:29)
    at bound (domain.js:301:14)
    at REPLServer.runBound [as eval] (domain.js:314:12)
question

Most helpful comment

"Oops, my mistake" - That helped me solve the problem too, thanks for elaborating.

All 9 comments

Oops, my mistake.

Could you please share your mistake @tlbtlbtlb ? That would be helpful to others that get the same error.

@tlbtlbtlb What was the solution to this error? I am getting the same error. Thanks.

"Oops, my mistake" - That helped me solve the problem too, thanks for elaborating.

@tlbtlbtlb would you still care to elaborate? Thanks

Edit: I solved my problem by wrapping my async function within an anonymous function:

async.parallel([ function(callback) {
    self.queues["genetic"].destroy(callback);
}

May not solve your specific issue but it solved mine!

async.parallel takes an array of functions. I was calling it like async.each.

Thanks 👍

How to solve TypeError: wrapAsync(...) is not a function

You're passing an undefined function as an iteratee, e.g. async.map(array, undefined, callback). Check your code in the call stack.

Was this page helpful?
0 / 5 - 0 ratings