question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Callback was already called.

See original GitHub issue

Hi, I’m using memfs with webpack and its watcher. After rebuild I want to read a file that was just built, but get this error:

    at throwError (C:\...\node_modules\neo-async\async.js:16:11)
    at C:\...\node_modules\neo-async\async.js:2818:7
    at C:\...\node_modules\neo-async\async.js:2830:7
    at done (C:\...\node_modules\neo-async\async.js:3517:9)
    at C:\...\node_modules\webpack\lib\Compiler.js:548:25
    at Immediate.<anonymous> (C:\...\node_modules\memfs\lib\volume.js:684:17)
    at processImmediate (internal/timers.js:456:21)```

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bpatathcommented, Sep 27, 2020

I got this issue too. I think it comes from an error in the Volume.wrapAsync method. Currently, the try block contains both calls to method and callback. Thus, if it is the callback which raises an exception, the callback will be called a second time in the catch block and the Callback was already called. will happen.

Calling the callback should probably be a separated step ensuring that the callback is only called once, e.g.:

let v = null, e = null;
try {
  v = method.apply(...);
} catch (err) {
  e = err;
}
callback(e, v);
1reaction
privatenumbercommented, May 14, 2021

Hope it’s alright if I work on a fix for this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Callback was already called async parallel - Stack Overflow
Hi I am trying to use the Async module to retrieve two users and do some processing after they have both been retrieved...
Read more >
Error "Callback was already called." even when was not called.
Error "Callback was already called." occurs when is no callback called. Look at my code, it looks like some overloading issue.
Read more >
Solved: CCL1043: Error when launching development server '...
CCL1043: Error when launching development server 'Callback was already called.' Go to solution.
Read more >
Uncaught Error: Callback was already called in mocha
Uncaught Error: Callback was already called in mocha ; 1) "before each" ; "deploy a contract": Uncaught ; Callback was already called. at...
Read more >
Callback already called error while running async.until with ...
Hi, Having an issue running processMessage in an infinite loop. Keeps failing on the 2nd run through processMessage saying Error:Callback is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found