0
votes

I am having a problem with some providers in my app.module.ts file. For example, I am using DatePicker and it is giving me this error:

Type 'DatePickerOriginal' is not assignable to type 'Provider'.
  Type 'DatePickerOriginal' is missing the following properties from type 'FactoryProvider': provide, useFactoryts(2322)

Here is how I am importing it:

import { DatePicker } from '@ionic-native/date-picker/ngx';

Ionic:

Ionic CLI : 5.4.16 Ionic Framework : ionic-angular 3.9.10 @ionic/app-scripts : 3.2.4

Cordova:

Cordova CLI : 8.1.2 ([email protected]) Cordova Platforms : ios 4.5.5 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, (and 19 other plugins)

Utility:

cordova-res : not installed native-run : not installed

System:

NodeJS : v14.15.4 (/usr/local/bin/node) npm : 6.14.10 OS : macOS Catalina

1
Please post the entirety of your app.module. The information you have provided is not sufficient to answer your question. Also how are you trying to run the app? - E. Maggini
Also check your all imports where you are importing DatePicker without ngx in any of your file. - Najam Us Saqib
Also make sure you have both installed correctly: ionic cordova plugin add cordova-plugin-datepicker npm install @ionic-native/date-picker - johnborges

1 Answers

0
votes

Using the solutions above, here is what worked:

To each Ionic plugin on EACH page, I added '/ngx' to the end. For good measure, I deleted the package-lock.json file. I then installed the date-picker using the command from above. That seemed to work