This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Ganache loading forever being stuck because project details loa…
…der never resolves/rejects The project loader is performed using a child spawn that should resolved or rejects at some point. However, it seems that in some cases (when some dependencies of the truffle project are missing), the child spawn will issue an 'exit` event without ever entering the 'error` event. This is problematic because since this is not trapped properly, the actual Ganache dependency that is waiting for project loading to happen never resolves and the Ganache UI is loading forever being stuck in this loop. To resolves that, the 'exit' signal is now catched as well as the standard error output of the process. When the child process exits with a bad error code and as now received the `error` event, a message is now forwarded within an `Error` object and the standard error output is present in there. This removes the infinite loop in Ganache and shows the actual standard error in the process. Caveats, this renders as 'Oups this is a bug' dialog in Ganache while it's really a problem with the truffle project not being configured correctly. I think it's good enough as a first solving, but this could be improved later on be provided a different UI saying the project is misconfigured or something like this.
- Loading branch information