Description
Command
test
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When trying to create a custom karma builder:
import { createBuilder } from "@angular-devkit/architect";
import {
execute as executeKarmaBuilder,
KarmaBuilderOptions,
} from "@angular/build/src/builders/karma";
export default createBuilder<KarmaBuilderOptions>(executeKarmaBuilder);
The builder compiles successfully but I get this issue when trying to run it with ng test
:
An unhandled exception occurred: Package subpath './src/builders/karma' is not defined by "exports" in /.../node_modules/@angular/build/package.json
The builder's execute function is marked experimental so I guess we should be able to use it (at my own risk), no?

Minimal Reproduction
Create a custom builder using the code above.
Exception or Error
An unhandled exception occurred: Package subpath './src/builders/karma' is not defined by "exports" in /.../node_modules/@angular/build/package.json
Your Environment
Angular CLI: 20.0.5
Node: 22.15.0
Package Manager: npm 10.9.2
OS: darwin arm64
Angular: 20.0.6
... common, compiler, compiler-cli, core, forms, localize
... platform-browser, platform-browser-dynamic, platform-server
... router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.2000.5
@angular-devkit/build-angular 20.0.5
@angular-devkit/core 20.0.5
@angular-devkit/schematics 20.0.5
@angular/build 20.0.5
@angular/cli 20.0.5
@angular/ssr 20.0.5
@schematics/angular 20.0.5
rxjs 7.8.2
Anything else relevant?
No response