{
  "id": 2403838,
  "title": "Fix: A Missing .catch() That Crashes Your Entire Node.js Process (ethers.js WebSocket Provider)",
  "url": "https://urgent.news/2026/08/21/fix-a-missing-catch-that-crashes-your-entire-node-js-process-ethers",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-21T16:21:59.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/ethanpark0301/fix-a-missing-catch-that-crashes-your-entire-nodejs-process-ethersjs-websocket-provider-1mn8"
  },
  "original_language": "en",
  "account": "This is a story about a bug discovered in ethers.js, a popular Ethereum library with over 3 million weekly downloads on npm. The bug lies within the WebSocketProvider, causing uncatchable unhandled rejections that result in crashes of production Node.js processes. The problem occurs when the provider returns a JSON-RPC error to an eth_subscribe call, such as an authentication failure or a 5xx status code behind a gateway. The rejection has no handler and becomes an unhandled rejection, which crashes the process. The fix involves modifying the start() method to use .then(onFulfilled, onRejected) instead of .catch(). The onRejected handler sets the filterId to null to clean up, but it includes an identity guard to ensure that the handler only clears its own promise and not a subsequent one. The fix also includes a stop() method that checks for null on the filterId before sending an eth_unsubscribe call, and includes tests to ensure that unhandled rejections are handled correctly.",
  "summary": "This is a submission for DEV's Summer Bug Smash: Clear the Lineup powered by Sentry . Project Overview ethers.js is one of the most widely used Ethereum libraries, with over 3 million weekly downloads on npm. It provides the core infrastructure that thousands of dApps, wallets, and blockchain tools depend on for interacting with EVM chains. I discovered a bug in the WebSocketProvider that causes…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}