Express and Node.js error tracking your coding agent can read
Updated 2026-11-22
The Runheed Node SDK captures uncaught exceptions and unhandled rejections on its own. In Express, one error-handling middleware adds the request method and URL to each error. Your agent then reads them in Claude Code, Cursor or any MCP client.
Set it up
1.Install the SDK.
terminalbashnpm install https://runheed.com/dl/runheed-0.1.7.tgz2.Initialize it before your app code and add the handler after your routes.
server.tstypescriptimport express from 'express'; import runheed, { expressErrorHandler } from 'runheed'; runheed.init({ dsn: process.env.RUNHEED_DSN!, environment: process.env.NODE_ENV, release: process.env.GIT_SHA }); const app = express(); // ...your routes app.use(expressErrorHandler()); app.listen(3000);3.Connect your agent, then sign in when it asks (other clients: /connect).
terminalbashclaude mcp add --transport http runheed https://runheed.com/api/mcp
The npm and PyPI releases are not out yet, so these commands install the same package files straight from runheed.com. Nothing else changes when the registry versions ship.
What it catches
- Errors thrown in routes and middleware, with method and URL (secret headers redacted)
- Uncaught exceptions and unhandled promise rejections in the process
- Errors you report yourself with runheed.captureException(err, { anything: "useful" })
What it does not do
- Queues catch job errors themselves, so report them from the failure event: BullMQ worker.on('failed', (job, err) => runheed.captureException(err, { queue: job?.queueName, job: job?.name }))
- No performance tracing: Runheed tracks errors only
Then ask your agent
> which Express routes threw in production today? fix the one with the most events and resolve it with the commit hash
Connect Runheed first: Claude Code, Cursor or another client. Then see how the agent fixes and resolves an error.
Common Node.js and Express errors
- Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
- Access to fetch at 'https://api.example.com/orders' from origin 'https://app.example.co...
- ZodError: [ { "expected": "string", "code": "invalid_type", "path": [ "email" ], "messa...
- TypeError: Cannot destructure property 'id' of 'undefined' as it is undefined.
- [UnhandledPromiseRejection: This error originated either by throwing inside of an async...
- Error: EMFILE: too many open files, open '/app/uploads/0412.jpg'
- MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error liste...
- [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
- MongoServerError: E11000 duplicate key error collection: app.users index: email_1 dup k...
- Error: self-signed certificate in certificate chain
- TypeError: Client is not a constructor