[ts]
Type ‘InAppBrowserOriginal’ is not assignable to type ‘Provider’.
Type ‘InAppBrowserOriginal’ is missing the following properties from type ‘FactoryProvider’: provide, useFactory [2322]
Masumi
March 7, 2019, 6:00am
2
I guess the new version of in-app-browser had something changed.
I solved this problem by uninstalling the latest version and installed the older version.
npm uninstall --save @ionic-native/in-app-browser
npm install --save @ionic-native/in-app-browser@^4.17.0
I hope this solution help you.
2 Likes
I had the same problem and it worked.
Thank you
I found that if I change the import statement to:
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
It works without issue. Sorry for the trouble!
opened 01:22AM - 29 Jan 19 UTC
closed 01:31AM - 29 Jan 19 UTC
**I'm submitting a ...** (check one with "x")
[x] bug report
**Current beha… vior:**
After installing the plugin via
`ionic cordova plugin add cordova-plugin-inappbrowser` and
`npm install @ionic-native/in-app-browser`
I import the module into the app.module with
`import { InAppBrowser } from '@ionic-native/in-app-browser';`
However, when adding to the providers array I get the following errors:
`Type 'InAppBrowserOriginal' is not assignable to type 'Provider'.
Type 'InAppBrowserOriginal' is missing the following properties from type 'FactoryProvider': provide, useFactory`
Also, when trying to import directly into a component, I get the following error:
`Cannot find name 'InAppBrowser'`
If I use InAppBrowserOriginal via imports, I can inject it into a component's constructor without TS linting issues. However, when running with that setup, I get the following error:
`Can't resolve all parameters`.
**Expected behavior:**
Per all the docs and anything else I can find, this is the proper way to install and import this package, however, the typescript won't compile.
**Steps to reproduce:**
See above
**Other information:**
So far, I have not been successful in finding any other information out there about this issue, which is why I believe I'm doing something wrong, but I'm unable to find it.
**Ionic info:** (run `ionic info` from a terminal/cmd prompt and paste output below):
```
Ionic:
ionic (Ionic CLI) : 4.8.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.1
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 8 other plugins)
System:
Android SDK Tools : 26.1.1 (/usr/local/share/android-sdk)
ios-deploy : 1.9.4
NodeJS : v10.15.0 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS High Sierra
Xcode : Xcode 10.0 Build version 10A255
```
3 Likes
Masumi
October 27, 2019, 2:55am
5
That’s a smarter way for this bug!
Thanks for sharing it
change the import statement to:
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
It works without issue.
1 Like