Angular
Set up debugger in an Angular project.
Last updated March 19, 2026
Angular
This guide covers adding debugger to an Angular project with SSR. The setup takes two steps.
| Feature | Support |
|---|---|
| Server console | Yes |
| Server errors | Yes |
| HTTP requests | Yes |
| Browser script injection | Manual |
1. Add script tags to index.html
Add the debugger scripts to src/index.html, before </body>:
<body>
<app-root></app-root>
<script>window.__DEBUGGER_INGEST_URL__="/_/d";</script>
<script src="/_/d.js" defer></script>
</body>
2. Instrument the server
In src/server.ts, add the debugger instrumentation after creating
the Express app:
import { instrumentExpress } from '@ephem-sh/debugger/angular'
const app = express()
instrumentExpress(app)
This sets up the log store, IPC bridge, console patching, and HTTP
middleware for the ingest endpoint and browser client script. It
no-ops when NODE_ENV is production.
Verify
npx ng serve
npx dbg statuspnpm dlx dbg statusbun x dbg statusyarn dlx dbg statusnpx dbg browser consolepnpm dlx dbg browser consolebun x dbg browser consoleyarn dlx dbg browser consoleProduction safety
instrumentExpress returns immediately when NODE_ENV is
production. The script tags in index.html load /_/d.js which
is only served by the debugger middleware in development — in
production they silently fail with no impact.
Full example
See the complete working example at examples/node/angular.



