Karma Disconnected / no captured browser Angular Origin: On your device Last updated 15 Oct 2026

Angular tests: Disconnected, because no message in 30000 ms. / ERROR [launcher]: Cannot start ChromeHeadless

ng test could not start or keep the browser Karma uses — Chrome is missing, runs as root in a container, or the test run hung.

Exact message you may see Disconnected, because no message in 30000 msCannot start ChromeHeadlessChromeHeadless have not captured in 60000 ms, killingERROR [launcher]: Chrome failed 2 times (timeout)No captured browser, open http://localhost:9876/
Seen on: Angular Angular CLI Linux

Meaning

In CI and Docker Chrome must start without a sandbox (--no-sandbox) or as a non-root user. "Disconnected, because no message in 30000 ms" usually means a test blocked the browser (infinite loop, unresolved promise without fakeAsync), or the machine is too slow. "Cannot start ChromeHeadless" means Chrome is not installed or CHROME_BIN is not set.

Common causes

  • Chrome/Chromium not installed or CHROME_BIN not set
  • Running as root in Docker without --no-sandbox
  • A test hangs (infinite loop, never-resolving promise)
  • Low memory/CPU in CI causing timeouts
  • Browser launch flags missing in karma.conf.js

⚡ Quick fix

  1. Use a custom launcher: ChromeHeadlessCI with --no-sandbox
  2. Install Chrome and set CHROME_BIN
  3. Find the hanging spec by running tests one by one (fdescribe)

Detailed fix by platform

Angular CLI

  1. ng test --watch=false --browsers=ChromeHeadlessCI

Linux

  1. export CHROME_BIN=$(which chromium) or install Chrome in the CI image

Code examples

karma.conf.js launcher

javascript
browsers: ['ChromeHeadlessCI'],
customLaunchers: {
  ChromeHeadlessCI: { base: 'ChromeHeadless', flags: ['--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage'] },
},
browserNoActivityTimeout: 120000,

How to diagnose

  1. Browser — Is Chrome found (CHROME_BIN)?
  2. Sandbox — Running as root/in Docker?
  3. Hang — Which spec blocks?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Cannot find control with name — Angular: Error: Cannot find control with name: 'email' (reactive forms) (Angular)Cannot find control w…Component is not resolved: templateUrl — Angular tests: Component 'X' is not resolved: templateUrl: ./x.component.html — Did you run and wait for 'resolveComponentResources()'? (Angular)Component is not reso…Could not find the builder's node package — Angular CLI: Could not find the '@angular-devkit/build-angular:browser' builder's node package / Cannot find module '@angular-devkit/build-angular/package.json' (Angular)Could not find the bu…exceeded maximum budget — Angular build: Error: bundle initial exceeded maximum budget. Budget 1.00 MB was not met by 120.00 kB with a total of 1.12 MB (Angular)exceeded maximum budg…Expected to be running in 'ProxyZone' — Angular tests: Error: Expected to be running in 'ProxyZone', but it was not found. (Angular)Expected to be runnin…NullInjectorError: No provider for ActivatedRoute! — Angular: NullInjectorError: No provider for ActivatedRoute! (also Router) — usually a unit test (Angular)NullInjectorError: No…Schema validation failed with the following errors — Angular CLI: Schema validation failed with the following errors: Data path "" must NOT have additional properties(xyz) (Angular)Schema validation fai…Karma Dis…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.