StaticInjectorError(Platform: core)[l -> n]: NullInjectorError: No provider for n!
See original GitHub issueIonic version: [x] 4.10.3
I’m submitting a …
[x] bug report [ ] feature request
Current behavior:
I am getting the following error when adding InAppBrowser.
ERROR Error: Uncaught (in promise): Error: StaticInjectorError[l -> n]: StaticInjectorError(Platform: core)[l -> n]: NullInjectorError: No provider for n! Error: StaticInjectorError[l -> n]: StaticInjectorError(Platform: core)[l -> n]: NullInjectorError: No provider for n! at e.get (core.js.pre-build-optimizer.js:8895) at core.js.pre-build-optimizer.js:9140 at e (core.js.pre-build-optimizer.js:9084) at e.get (core.js.pre-build-optimizer.js:8981) at core.js.pre-build-optimizer.js:9140 at e (core.js.pre-build-optimizer.js:9084) at e.get (core.js.pre-build-optimizer.js:8981) at Ra (core.js.pre-build-optimizer.js:21217) at e.get (core.js.pre-build-optimizer.js:21906) at Ra (core.js.pre-build-optimizer.js:21217) at P (zone.js.pre-build-optimizer.js:831) at P (zone.js.pre-build-optimizer.js:788) at zone.js.pre-build-optimizer.js:892 at e.invokeTask (zone.js.pre-build-optimizer.js:423) at Object.onInvokeTask (core.js.pre-build-optimizer.js:17289) at e.invokeTask (zone.js.pre-build-optimizer.js:422) at t.runTask (zone.js.pre-build-optimizer.js:195) at g (zone.js.pre-build-optimizer.js:601) at t.invokeTask [as invoke] (zone.js.pre-build-optimizer.js:502) at m (zone.js.pre-build-optimizer.js:1744)
It is working fine natively on my phone but not in any browser in PRODUCTION. I also could add the InAppBrowser to the providers in AppModule since it is says the following:
TS2322: Type 'InAppBrowserOriginal' is not assignable to type 'Provider'. Type 'InAppBrowserOriginal' is not assignable to type 'FactoryProvider'. Property 'provide' is missing in type 'InAppBrowserOriginal'.
Due to the this, the page where InAppModule is injected doesn’t even load in browsers.
FYI: I am just following the latest ionic documentation for InAppBrowser.
Steps to reproduce: I am just following the latest ionic documentation for InAppBrowser. https://ionicframework.com/docs/native/in-app-browser
Ionic info:
Ionic:
ionic (Ionic CLI) : 4.10.3 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.2
@angular-devkit/build-angular : 0.12.4
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.2.4
@ionic/angular-toolkit : 1.4.0
Cordova:
cordova (Cordova CLI) : not installed
Cordova Platforms : not available
Cordova Plugins : not available
System:
Android SDK Tools : 26.1.1 (/opt/android_sdk)
NodeJS : v11.10.0 (/usr/local/bin/node)
npm : 6.8.0
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (3 by maintainers)
Top GitHub Comments
Fixed it.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.