Developer tools dump stack traces, exit codes, and jargon. Figuring out *what to do next* often means searching the same Stack Overflow answers again.
| Rule( |
| 9 | id="node.econnrefused", |
| 10 | tool="node", |
| 11 | title="Connection refused", |
| 12 | why="A TCP connection was refused — the target host/port is not accepting connections.", |
| 13 | checks=( |
| 14 | "Is the target service running?", |
| 15 | "Is the host and port correct?", |
| 16 | "Is a firewall blocking the connection?", |
| 17 | ), |
| 18 | fixes=( |
| 19 | "Start the service listening on that port", |
| 20 | "Verify the connection URL / host / port", |
| 21 | ), |
| 22 | patterns=( |
| 23 | Pattern("ECONNREFUSED", kind="exact", required=True), |
| 24 | ), |
| 25 | confidence="medium", |
| 26 | secondary=("connect", "Error:"), |
| 27 | ), |
| 28 | Rule( |
| 29 | id="node.eaddrinuse", |
| 30 | tool="node", |
| 31 | title="Port already in use (EADDRINUSE)", |
| 32 | why="Another process is already bound to the port your Node app tried to listen on.", |
| 33 | checks=( |
| 34 | "Which process owns the port?", |
| 35 | "Can you stop the other process or use a different port?", |
| 36 | ), |
| 37 | fixes=( |
| 38 | "Find the process: lsof -i :<port> (or on Windows: netstat -ano)", |
| 39 | "Stop it, or set a different PORT", |
| 40 | ), |
| 41 | patterns=( |
| 42 | Pattern("EADDRINUSE", kind="exact", required=True), |
| 43 | ), |
| 44 | confidence="high", |
| 45 | secondary=("listen", "address already in use"), |
| 46 | ), |
| 47 | Rule( |
| 48 | id="node.heap_out_of_memory", |
| 49 | tool="node", |
| 50 | title="Node.js heap out of memory", |
| 51 | why="The V8 heap exceeded its limit — often a memory leak or too-large workload.", |
| 52 | checks=( |
| 53 | "Is the process handling huge data in memory?", |
| 54 | "Is there a memory leak?", |
| 55 | "Is the default heap too small for this job?", |
| 56 | ), |
| 57 | fixes=( |
| 58 | "NODE_OPTIONS=--max-old-space-size=4096 <command>", |
| 59 | "Profile memory usage and reduce retained objects", |
| 60 | ), |
| 61 | patterns=( |
| 62 | Pattern( |
| 63 | r"heap out of memory|FATAL ERROR: Reached heap limit|" |
| 64 | r"JavaScript heap out of memory", |
| 65 | kind="regex", |
| 66 | required=True, |
| 67 | ), |
| 68 | ), |
| 69 | confidence="high", |
| 70 | secondary=("node", "allocation failed"), |
| 71 | ), |
| 72 | Rule( |
| 73 | id="node.enetunreach", |
| 74 | tool="node", |
| 75 | title="Network unreachable (ENETUNREACH)", |
| 76 | why="The OS reported that the destination network cannot be reached from this machine.", |
| 77 | checks=( |
| 78 | "Are you offline or on a restricted network?", |
| 79 | "Is the destination IP/host correct?", |
| 80 | "Is a VPN required?", |
| 81 | ), |
| 82 | fixes=( |
| 83 | "Check network connectivity", |
| 84 | "Verify VPN / DNS / routing", |
| 85 | ), |
| 86 | patterns=( |
| 87 | Pattern("ENETUNREACH", kind="exact", required=True), |
| 88 | ), |
| 89 | confidence="high", |
| 90 | ), |
| 91 | Rule( |
| 92 | id="node.etimedout", |
| 93 | tool="node", |
| 94 | title="Connection timed out (ETIMEDOUT)", |
| 95 | why="A network operation did not complete before the timeout expired.", |
| 96 | checks=( |
| 97 | "Is the remote service slow or down?", |
| 98 | "Is the timeout too aggressive?", |
| 99 | "Is there a network/firewall issue?", |
| 100 | ), |
| 101 | fixes=( |
| 102 | "Verify the remote endpoint is reachable", |
| 103 | "Increase the client timeout if appropriate", |
| 104 | ), |
| 105 | patterns=( |
| 106 | Pattern("ETIMEDOUT", kind="exact", required=True), |
| 107 | ), |
| 108 | confidence="medium", |
| 109 | secondary=("timeout",), |
| 110 | ), |
| 111 | Rule( |
| 112 | id="node.econnreset", |
| 113 | tool="node", |
| 114 | title="Connection reset (ECONNRESET)", |
| 115 | why="The remote peer closed the TCP connection abruptly.", |
| 116 | checks=( |
| 117 | "Did the remote service crash or restart?", |
| 118 | "Is a proxy or load balancer terminating idle connections?", |
| 119 | ), |
| 120 | fixes=( |
| 121 | "Retry the request", |
| 122 | "Check remote service health and keep-alive settings", |
| 123 | ), |
| 124 | patterns=( |
| 125 | Pattern("ECONNRESET", kind="exact", required=True), |
| 126 | ), |
| 127 | confidence="medium", |
| 128 | ), |
| 129 | Rule( |
| 130 | id="node.syntax_error", |
| 131 | tool="node", |
| 132 | title="JavaScript syntax error", |
| 133 | why="Node failed to parse a JavaScript/TypeScript-compiled file due to invalid syntax.", |
| 134 | checks=( |
| 135 | "Which file and line are reported?", |
| 136 | "Is there a mismatched bracket, quote, or invalid token?", |
| 137 | ), |
| 138 | fixes=( |
| 139 | "Open the reported file:line and fix the syntax", |
| 140 | "Ensure the file is being parsed with the intended module type", |
| 141 | ), |
| 142 | patterns=( |
| 143 | Pattern("SyntaxError:", kind="exact", required=True), |
| 144 | Pattern( |
| 145 | r"Unexpected token|Unexpected end of input|Invalid or unexpected token", |
| 146 | kind="regex", |
| 147 | ), |
| 148 | ), |
| 149 | confidence="medium", |
| 150 | secondary=("node",), |
| 151 | ), |
| 152 | ] |