From 0b6ebb2b02f734aa277ad4bf64c15a831bea857c Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Tue, 26 Aug 2025 20:41:14 -0400 Subject: [PATCH] fix(@angular/build): ensure karma polyfills reporter factory returns a value The factory function for the `reporter:angular--polyfills` Karma plugin did not return a value, which violates Karma's plugin contract. This could cause Karma to crash when multiple reporters were in use, particularly with tools that use Karma's multi-reporter functionality. This change modifies the factory to return an object with an empty `adapters` array (`{ adapters: [] }`). This satisfies Karma's plugin requirements and ensures compatibility with the multi-reporter, preventing the crash. Fixes #31039 --- .../angular/build/src/builders/karma/application_builder.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/angular/build/src/builders/karma/application_builder.ts b/packages/angular/build/src/builders/karma/application_builder.ts index ae238b7239cf..004c46930ff9 100644 --- a/packages/angular/build/src/builders/karma/application_builder.ts +++ b/packages/angular/build/src/builders/karma/application_builder.ts @@ -187,6 +187,9 @@ class AngularPolyfillsPlugin { included: true, watched: false, }); + + // Karma needs a return value for a factory and Karma's multi-reporter expects an `adapters` array + return { adapters: [] }; }, AngularPolyfillsPlugin), ], };