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

neo-async/async.js:throwError doesnt display very useful error for all cases. #81

Open
hiraditya opened this issue Mar 15, 2020 · 5 comments
Labels

Comments

@hiraditya
Copy link

hiraditya commented Mar 15, 2020

neo-async/async.js has the throwError function which is called several times. It will help if this function takes a parameter and shows exactly what error was there.

  15   var throwError = function throwError() {
  16     throw new Error('Callback was already called.');
  17   };

Example, in the following snippet same function is used for different errors.

3828       return function(err, res) {
3829         if (index === null) {
3830           throwError();
3831         }
3832         if (err) {
3833           index = null;
3834           iterate = noop;
3835           callback = once(callback);
3836           callback(err, createArray(result));
3837           return;
3838         }
3839         result[index] = res;
3840         index = null;
3841         if (++completed === size) {
3842           iterate = throwError;
3843           callback(null, result);
3844           callback = throwError;
3845         } else if (sync) {
3846           nextTick(iterate);
3847         } else {

I'm getting the following error but I cant figure out the call stack, if the error message were helpful that'd be great.

Error: Callback was already called.
    at throwError (/home/node_modules/neo-async/async.js:16:11)
    at /home/node_modules/neo-async/async.js:2818:7
    at processTicksAndRejections (internal/process/task_queues.js:79:11)
@suguru03
Copy link
Owner

@hiraditya Thanks for the issue!
Bluebird and Aigle have the longStackTrace feature, so it should be doable.
But it could affect performance, I will investigate it carefully.

@ahmad-reza619
Copy link

Hello, is there any update on this issue?

@Artofaj
Copy link

Artofaj commented Feb 18, 2021

I'm having the same problem and can't figure out any solution. Anyone?

@Aymkdn
Copy link

Aymkdn commented Oct 11, 2021

I've had this issue when using Windows because the path of my folder where I entered was in lower case when the correct name is upper case. It worked when I entered the correct path.

Explanations:

cd myfolder/
npm run build
» Error: Callback was already called.
cd ..
cd MYFOLDER/
npm run build
» SUCCESS

@codigoisaac
Copy link

I've had this issue when using Windows because the path of my folder where I entered was in lower case when the correct name is upper case. It worked when I entered the correct path.

Explanations:

cd myfolder/
npm run build
» Error: Callback was already called.
cd ..
cd MYFOLDER/
npm run build
» SUCCESS

This fixed my issue. I was not able to build with Vue CLI.

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

6 participants