Skip to content
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

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

Closed
tlbtlbtlb opened this issue Jun 11, 2017 · 9 comments
Closed

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

tlbtlbtlb opened this issue Jun 11, 2017 · 9 comments
Labels

Comments

@tlbtlbtlb
Copy link

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)
@tlbtlbtlb
Copy link
Author

Oops, my mistake.

@andre0799
Copy link

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

@ghost
Copy link

ghost commented Jul 27, 2017

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

@TheRationalizer
Copy link

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

@samhmills
Copy link

samhmills commented Sep 1, 2017

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

@tlbtlbtlb
Copy link
Author

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

@TheRationalizer
Copy link

Thanks 👍

@likping
Copy link

likping commented Apr 13, 2019

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

@aearly
Copy link
Collaborator

aearly commented Apr 13, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants