You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Karma reporter:angular-polyfills factory does not return a reporter which breaks karma in some situations #31039
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
When migrating/upgrading from angular 19 to 20 the update tool migrated the tests from @angular-devkit/build-angular to @angular/build
This means the webpack plugin is not used anymore, but a new angular-polyfills plugin is now used. Which is defined in @angular/build package. It's good to understand that karma uses the di library for it's dependency injection. The AngularPolyfillsPlugin is defined in such a way. The type is set to factory and a function is provided, which is run by karma. All is fine so far, however karma expects the factory function to return a reporter. This is currently not happening. It just returns undefined.
When using the karma test explorer plugin for Visual Code karma will load all defined reporters in the MultiReporter defined in multi.js in the karma project class. This will access the adapters property of every reporter and push to it.
The problem is, the factory function of the angular-polyfills reporter returns undefined. Therefor kamra crashes on startup if run with multiple reporters, which it does in case of the Karma Test Explorer extension. If the factory function would return { adapters:[] } all works fine and Karma Test Explorer is all happy again, because now karma does not crash when executed.
However I am not an expert at all in karma reporters and the di library. So it is very well possible, some other solution, change is more appropriate to fix this issue. And I am fully aware karma is deprecated, but because there is no stable, non experimental replacement available just yet, I would really really appreciate it, if this plugin get fixed so karma will work again in scenarios other as ng test.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run ng version)
Activity
fix(@angular/build): ensure karma polyfills reporter factory returns …
fix(@angular/build): ensure karma polyfills reporter factory returns …
fix(@angular/build): ensure karma polyfills reporter factory returns …
angular-automatic-lock-bot commentedon Sep 27, 2025
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.