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.

Angular official docs

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 status
pnpm dlx dbg status
bun x dbg status
yarn dlx dbg status
npx dbg browser console
pnpm dlx dbg browser console
bun x dbg browser console
yarn dlx dbg browser console

Production 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.

Search Documentation

Search for pages and content