angular-builders icon indicating copy to clipboard operation
angular-builders copied to clipboard

@angular-builders/custom-webpack:karma hanging with Angular v20

Open danwulff opened this issue 7 months ago • 4 comments

Describe the Bug

@angular-builders/custom-webpack:karma is hangind with "Incomplete: No specs found" message when an external karma config is utilized with Angular 20

Minimal Reproduction

https://github.com/danwulff/angular-builders_karma

Reproduction steps:

  1. clone repo
  2. npm ci
  3. ng test

Steps used to create reproduction (also see commit history within repo):

  1. npm i @angular/cli@20 -g
  2. ng new
  3. ng generate config karma
  4. Steps found here: https://github.com/just-jeb/angular-builders/tree/master/packages/custom-webpack#usage

Expected Behavior

@angular-builders/custom-webpack:karma should work with Angular 20, with a karma config file.

Screenshots

Image

Environment

Libs
- @angular/core version: 20.0.6
- @angular-devkit/build-angular version: n/a
- @angular/build version: 20.0.5
- @angular-builders/custom-webpack version: 20.0.0

For Tooling issues: 
- Node version: v22.17.0
- NPM version: v10.9.2
- Platform:  Mac

Additional Context

In @angular/cli v20 @angular/build is installed as a direct dependency instead of @angular-devkit/build-angular. However adding @angular-devkit/build-angular to the package.json does not resolve this issue.

I'm happy to debug further but without any error messaging I'm unsure where to go from here.

Removing "karmaConfig": "karma.conf.js" from angular.json also fixes the issue.

danwulff avatar Jul 03 '25 12:07 danwulff

Ah ok, I think this may be a documentation issue actually.

https://github.com/danwulff/angular-builders_karma/compare/main...fix

Image

In Angular 20 the ng generate config karma command does not include the @angular-devkit lines in the karma config. Adding those back from what Angular 19 generates seems to fix the issue.

danwulff avatar Jul 03 '25 12:07 danwulff

I'm happy to open a PR to update the docs, but I'm uncertain where the docs should be updated.

https://github.com/just-jeb/angular-builders/tree/master/packages/custom-webpack

Maybe under Usage? or under Custom Webpack karma? Or would we prefer a new section added to the Readme?

danwulff avatar Jul 03 '25 12:07 danwulff

Sounds like Custom Webpack karma is the right section (we're talking here about karma config here, right)? PR would be appreciated, thank you 🙏.

just-jeb avatar Jul 09 '25 15:07 just-jeb

@just-jeb https://github.com/just-jeb/angular-builders/pull/1929 created

danwulff avatar Jul 11 '25 07:07 danwulff