-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
callback is not a function #1901
Comments
I had a similar problem but then learned that if you're using an https://caolan.github.io/async/v3/global.html
|
@pankaj110987, i had also the same issue this is how you can resolve this issue await new Promise((resolve, reject) => {
async.mapSeries(
[1, 2, 3, 4],
async (id) => {
let user;
try {
user = await findOneById(1);
if (user) {
resolve(user);
}
} catch (error) {
reject(error);
}
}
)
}); |
@abhaysinghs772 that wont work like you expect, it'll |
What version of async are you using?
3.2.4
Which environment did the issue occur in (Node/browser/Babel/Typescript version)
Node Js 18
What did you do? Please include a minimal reproducible case illustrating issue.
async.eachSeries([1,2,3], async(item, cb) => {
//await delay(6000);
console.log(item);
cb(null);
}, function(done) {
if(done == null){
}
});
What did you expect to happen?
It should work
What was the actual result?
It gives the error cb is not defined.
The text was updated successfully, but these errors were encountered: