Bug fix proposed for ethers.js WebSocket provider that silently crashes Node.js apps
A developer has identified and submitted a fix for a bug in the ethers.js WebSocketProvider that causes Node.js production processes to crash without warning. The issue arises when an eth_subscribe call returns a JSON-RPC error — such as an authentication failure or a 500 gateway response — leaving an unhandled promise rejection that terminates the process. Because the subscription promise is stored privately with only a .then() handler, application-level try/catch blocks cannot intercept the error. The fix replaces the incomplete promise chain with a .then(onFulfilled, onRejected) pattern that absorbs the rejection and emits an error event instead of crashing. A pull request addressing the issue has been opened against the ethers-io/ethers.js repository on GitHub.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in