Skip to content

Encountering a NullInjectorError: No provider for _RadioControlRegistry! error when using @defer block #54117

@surajchopra16

Description

@surajchopra16

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

Yes

Description

Encountering a NullInjectorError: No provider for _RadioControlRegistry! error when using an input type="radio" element within a component that is defer loaded using the @ defer block in Angular. This issue seems to prevent radio button functionality within defer-loaded components

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/~/github.com/surajchopra1234/demo

Please provide the exception or error you saw

ERROR NullInjectorError: R3InjectorError(Standalone[_AppComponent])[_RadioControlRegistry -> _RadioControlRegistry -> _RadioControlRegistry]: 
  NullInjectorError: No provider for _RadioControlRegistry!
    at NullInjector.get (core.mjs:5682:27)
    at R3Injector.get (core.mjs:6125:33)
    at R3Injector.get (core.mjs:6125:33)
    at R3Injector.get (core.mjs:6125:33)
    at ChainedInjector.get (core.mjs:15424:36)
    at lookupTokenUsingModuleInjector (core.mjs:4193:39)
    at getOrCreateInjectable (core.mjs:4241:12)
    at ɵɵdirectiveInject (core.mjs:12042:19)
    at NodeInjectorFactory.RadioControlValueAccessor_Factory [as factory] (forms.mjs:4766:127)
    at getNodeInjectable (core.mjs:4447:44)

Please provide the environment you discovered this bug in (run ng version)

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 17.1.1
Node: 20.9.0
Package Manager: npm 10.2.3
OS: win32 x64

Angular: 17.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, ssr

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1701.1
@angular-devkit/build-angular   17.1.1
@angular-devkit/core            17.1.1
@angular-devkit/schematics      17.1.1
@schematics/angular             17.1.1
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.3

Anything else?

No response

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimecore: deferIssues related to @defer blocks.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions