Dec 2, 2025 · Updated Jun 8, 2026

How to Fix Karma in Angular 20: Missing Builder Error Solved

angularkarmatestingmigrationvitestgde

Angular 20 removed the Karma builder. Learn exactly how to restore it temporarily or migrate to Vitest in 5 minutes.

How to Fix Karma in Angular 20: The “Missing Builder” Error Solved

You just finished the upgrade. You ran ng update, everything looked green, and you felt great. Then you typed ng test and the terminal screamed at you:

Schema validation failed with the following errors: Data path "" must have required property 'karmaConfig'

If you are staring at this error, you are not alone. In Angular 20, the team finally pulled the plug on the legacy build system. Here is exactly why this broke, and the two ways you can fix it—whether you need a quick patch or a permanent solution.

The “Why”: Goodbye Webpack, Hello esbuild

For years, Angular relied on Webpack to bundle your code and Karma to run your tests in a real browser. It worked, but it was slow.

In Angular 20, the CLI defaults entirely to the new Application Builder based on esbuild and Vite. This new builder is blazingly fast, but it has one catch: It does not support Karma.

When you run ng test now, the CLI is looking for a Karma configuration that the new builder simply doesn’t understand.

Solution A: The “Quick Fix” (Retro-fitting)

Use this if you have a massive test suite (500+ tests) and cannot afford to rewrite them today.

To get your tests passing again without changing a single line of test code, we need to manually reinstall the “Legacy” builder that Angular 20 doesn’t include by default.

Step 1: Install the Legacy Builder

Run this command to bring back the Webpack-based architecture:

npm install --save-dev @angular-devkit/build-angular

Step 2: Update angular.json

You need to tell Angular to stop using the new application builder for tests and go back to the old browser builder.

Open your angular.json and find the "test" target. Change the builder string:

"test": { // CHANGE THIS LINE: // "builder": "@angular/build:test", // TO THIS: "builder": "@angular-devkit/build-angular:karma", "options": { "polyfills": ["zone.js", "zone.js/testing"], "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js" } }

Run ng test again. It will be slower than the new tools, but it will work.

Solution B: The “Real Fix” (Migrate to Vitest)

Use this if you want instant test feedback and future-proof code. This is the GDE-recommended path.

The ecosystem has moved on. Vitest is the spiritual successor to Karma/Jasmine but runs on Vite. It is instant, headless by default, and fully compatible with Angular 20.

Step 1: Run the Experimental Migration

Angular 20 includes a schematic to do the heavy lifting for you.

ng generate @angular/core:testing

Note: Select “Vitest” when prompted.

Step 2: Verify angular.json

The CLI should automatically update your builder to the new experimental runner:

"test": { "builder": "@angular/build:test", // The new standard "options": { "runner": "vitest" } }

Why you should switch today

I recently migrated a client’s government dashboard from Karma to Vitest. Look at the difference:

FeatureKarma (Legacy)Vitest (Modern)
Startup Time12s - 20s< 400ms
EngineReal Browser (Chrome)Vite (Node.js/JSDOM)
DebuggingBrowser ConsoleTerminal / VS Code
Future Proof?❌ Deprecated✅ Industry Standard

Final Thoughts

The error must have required property 'karmaConfig' is annoying, but it’s a signal. It’s the framework telling you that the tools of 2016 (Webpack/Karma) are no longer the tools of 2025.

If you are on a tight deadline, use Solution A. But put a ticket in your backlog to implement Solution B. Your CI/CD pipeline (and your developers) will thank you.

Need help migrating a complex repo? Check out my GDE profile or ping me on Twitter.


This error usually appears mid-upgrade — the full walkthrough is in Upgrade Angular 19 to 20, and every other version jump is in the Angular Upgrade Guide.

Written by

Antonio Cárdenas

Google Developer Expert in Angular · Verified GDE profile · Google Developers profile

My technical writing reaches 100,000+ developers in English and Spanish. I've migrated production Angular apps from v8 to v22 — everything I publish is built from real project work, not documentation re-reads.

Frequently asked questions

FAQs

Why is ng test broken after upgrading to Angular 20?

Angular 20 defaults to the new esbuild-based application builder, which does not support the Karma test runner. When you run ng test, Angular expects a Karma configuration that the new builder doesn't understand, causing the 'must have required property karmaConfig' schema validation error.

How do I fix the 'karmaConfig' error in Angular 20?

Two options: (1) Quick fix — reinstall the legacy builder with npm install --save-dev @angular-devkit/build-angular and update angular.json to use builder: '@angular-devkit/build-angular:karma'. (2) Permanent fix — migrate to Vitest by running ng generate @angular/core:karma-to-vitest, then set builder: '@angular/build:test' with options.runner: 'vitest' in angular.json.

How do I migrate from Karma to Vitest in Angular 20?

Run the Angular schematic: ng generate @angular/core:karma-to-vitest. This auto-converts your test configuration. Then update angular.json to use builder: '@angular/build:test' with runner: 'vitest'. After migration, remove karma.conf.js from your project.

Is Karma still supported in Angular 20?

Karma is not the default in Angular 20 but can still be used by manually installing @angular-devkit/build-angular and updating angular.json to use the legacy @angular-devkit/build-angular:karma builder. This is a deprecated path — the Angular team recommends migrating to Vitest.

What is the difference between Karma and Vitest in Angular?

Karma runs tests in a real browser using Webpack, taking 12–20 seconds to start. Vitest runs tests in Node.js using Vite, starting in under 400ms. Vitest is actively maintained and is the Angular team's recommended test runner from Angular 20 onwards.

Keep reading

Building something with Angular?

I write about Angular architecture, Signals and the tooling around them — migration guides, real upgrade paths, and the catches most posts skip.

Browse all articlesAbout me

More from the blog