Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
PR #61354 introduces a critical bug.
The application can't be started at all, the error occurs: "RuntimeError: NG0200: Circular dependency in DI detected for _ApplicationRef. Find more at https://angular.dev/errors/NG0200".
It seems the source of the problem is the code: private readonly appRef = inject(ApplicationRef);
Please provide a link to a minimal reproduction of the bug
The application is configured with provideHttpClient( withFetch(), withInterceptorsFromDi() ).
Exception occurs in method hydrate(token, record, flags) while resolving ApplicationRef in the FetchBackend class:
if (record.value === CIRCULAR) {
throwCyclicDependencyError(stringify(token));
The token here is the "class _ApplicationRef" and the record is the "{ factory: ƒ ApplicationRef_Factory(ngFactoryType), ... }".
Please provide the exception or error you saw
RuntimeError: NG0200: Circular dependency in DI detected for _ApplicationRef. Find more at https://angular.dev/errors/NG0200
at throwCyclicDependencyError (core.mjs:978:9)
at R3Injector.hydrate (core.mjs:2238:9)
at R3Injector.get (core.mjs:2121:23)
at injectInjectorOnly (core.mjs:1111:28)
at ɵɵinject (core.mjs:1117:40)
at inject (core.mjs:1202:10)
at <instance_members_initializer> (module-BQ-7fJZl.mjs:1620:12)
at new _FetchBackend (module-BQ-7fJZl.mjs:1612:1)
at Object.FetchBackend_Factory [as factory] (module-BQ-7fJZl.mjs:1832:12)
at core.mjs:2243:35
at runInInjectorProfilerContext (core.mjs:881:5)
at R3Injector.hydrate (core.mjs:2242:11)
at R3Injector.get (core.mjs:2121:23)
at injectInjectorOnly (core.mjs:1111:28)
at ɵɵinject (core.mjs:1117:40)
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 19.2.12 Node: 24.1.0 (Unsupported) Package Manager: npm 11.4.1 OS: win32 x64 Angular: 19.2.12 ... animations, cli, common, compiler, compiler-cli, core, forms ... platform-browser, router Package Version --------------------------------------------------------- @angular-devkit/architect 0.1902.12 @angular-devkit/build-angular 19.2.12 @angular-devkit/core 19.2.12 @angular-devkit/schematics 19.2.12 @schematics/angular 19.2.12 rxjs 7.8.2 typescript 5.8.3 zone.js 0.15.1
Anything else?
This is the regression, because prior to the version 19.2.12 application started successfully.
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
PR #61354 introduces a critical bug.
The application can't be started at all, the error occurs: "RuntimeError: NG0200: Circular dependency in DI detected for _ApplicationRef. Find more at https://angular.dev/errors/NG0200".
It seems the source of the problem is the code:
private readonly appRef = inject(ApplicationRef);Please provide a link to a minimal reproduction of the bug
The application is configured with
provideHttpClient( withFetch(), withInterceptorsFromDi() ).Exception occurs in method
hydrate(token, record, flags)while resolving ApplicationRef in the FetchBackend class:The token here is the "class _ApplicationRef" and the record is the "{ factory: ƒ ApplicationRef_Factory(ngFactoryType), ... }".
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version)Anything else?
This is the regression, because prior to the version 19.2.12 application started successfully.