The code attempted to attach an .on('error') handler directly to the Express
app, but Express apps don't emit 'error' events - they're JavaScript functions,
not EventEmitters. Server-level errors are emitted by the http.Server instance
returned by app.listen(), not the Express app itself.
Runtime request/response errors in Express are properly handled through
error-handling middleware (already present at lib/app/server-config.ts:75-83)
and Sentry's error handler (line 72), making the .on('error') call both
ineffective and redundant.
The stricter Express type definitions in the dependency update correctly
reject this incorrect pattern.
References:
- https://github.com/expressjs/express/issues/1860
- https://expressjs.com/en/guide/error-handling.html🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>