bug: core.js:6228 ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError
See original GitHub issueBug Report
Ionic version:
[x] 5.2
Current behavior: Whenever entering a page with some components like
- ion-radio-group
- ion-range
- ion-searchbar
I got this error:
Expected behavior: Not have any error.
Steps to reproduce: Just update to latest ionic and angular and insert this snippet anywhere
Related code:
<ion-content >
<ion-radio-group></ion-radio-group>
</ion-content>
Other information: After updating to new ionic and angular I started getting this error.
Ionic info:
Ionic:
Ionic CLI : 6.9.2 (/usr/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.2.0
@angular-devkit/build-angular : 0.901.7
@angular-devkit/schematics : 9.1.7
@angular/cli : 9.1.7
@ionic/angular-toolkit : 2.2.0
Capacitor:
Capacitor CLI : 2.2.0
@capacitor/core : 2.2.0
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v14.2.0 (/usr/bin/node)
npm : 6.14.5
OS : Linux 5.6
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:20 (5 by maintainers)
Top Results From Across the Web
Uncaught (in promise): NullInjectorError: R3InjectorError ...
ts ; when i am going to add the AccessProviders path in the project the project says: ERROR Error: Uncaught (in promise): NullInjectorError: ......
Read more >NullInjectorError- Angular not able to find custom service
Let me introduced you to the Error, detail, and Fix. ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(HomePageModule)[ ...
Read more >Uncaught (In Promise): Error: No Provider For Httpservice
You see this error when you try to inject a service but have not declared a corresponding provider. A provider is a mapping...
Read more >No provider for HttpClient! angular test service Code Example
Error : Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[HttpClient -> HttpClient -> HttpClient]: NullInjectorError: No provider for ...
Read more >How can I reproduce this stack trace with "Uncaught ... - Reddit
Please help me report a DevTools bug related to Angular ... core.js:1449 ERROR Error: Uncaught (in promise): things broke!! at ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have the same issue with ion-segment in the page. Turns out in ionic 5.2 it requires [(ngModel)] present.
in my case: from:
to:
Thanks for the issue. This has been resolved via https://github.com/ionic-team/ionic/pull/21504, and a fix is now available as part of the Ionic Framework 5.2.1 release. Please update to v5.2.1 in order to receive this bug fix:
This bug was caused by https://github.com/ionic-team/ionic/commit/e95b481a53191582bca635f322ad07eadbd62d64. When attempting to get an
NgControl
on a component, Angular threw an error for components that were not part of a form/did not havengModel
.The fix for this involves checking to see if the component in question is part of a form/has an
ngModel
to avoid this error.Apologies for any inconvenience this may have caused. For any additional bugs, please open a new issue. Thanks for using Ionic!