I am building SSR rendered Gatsby react application and I get the following error while doing "gatsby build". Been searching for a solution for this error for a good couple of days as it is hard to find out what is causing this error from the description itself. All the description says is "Callback was already called"
C:\Users\<project_folder>\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53
throw ex;
^
Error: Callback was already called.
at throwError (C:\Users\<project_folder>\node_modules\neo-async\async.js:16:11)
at C:\Users\<project_folder>\node_modules\neo-async\async.js:2818:7
at processTicksAndRejections (internal/process/task_queues.js:75:11)
error Command failed with exit code 7.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I am using vuejs (which uses webpack) and was running into this same issue. I was using yarn as my package manager and tried upgrading and reinstalling all my dependencies and clearing cache, nothing seemed to work.
Although I did find a solution for my case. It seems vuejs (or webpack - not entirely sure) is very case sensitive to the file and folder names, I had various case styles in my absolute folder path which seemed to cause a problem in git bash. When I used cmd however, it did work. I have reason to believe that cmd normalizes this issue.
In brief: Try cmd if git bash gave you errors.
This can happen on Windows if your current directory on the command prompt doesn't match the casing of the folder you are in.
Let's say, for example, your project is in C:\Development\project (the Development folder has a capital letter at the start).
If the path to the current directory on your shell is C:\development\project (lowercase D in Directory, which is incorrect), which Windows will happily allow, it can cause this problem when using vue-cli. To get around it, change the current directory's path on your shell to use proper capitalization.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With