I want to build a simple file picker for one of my Ionic (web) project, to titrate some of images from project folder (at least for now).
So I decided to use the "cordova-plugin-file" plugin --- version "^6.0.2".
As per the ionic documentation
import { File } from "@ionic-native/file/ngx"; and providers: [....,File, FileOpener }], in AppModule
import { File } from '@ionic-native/file/ngx'; and constructor(private file: File) { } in component/page, is required further.
This should be pretty straight, however, when I tried to implement this, I get the following error and the compilation fails.
Terminal Log:
ng.cmd run app:serve --host=localhost --port=8100 [ng] chunk {main} main.js, main.js.map (main) 2.02 kB [initial] [rendered] [ng] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 127 kB [initial] [rendered] [ng] chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered] [ng] chunk {styles} styles.js, styles.js.map (styles) 93 kB [initial] [rendered] [ng] chunk {vendor} vendor.js, vendor.js.map (vendor) 341 kB [initial] [rendered] [ng] ERROR in src/app/app.module.ts:18:100 - error TS2322: Type '{ provide: typeof RouteReuseStrategy; useClass: typeof IonicRouteStrategy; File: typeof File; FileOpener: typeof FileOpener; }' is not assignable to type 'Provider'. [ng] Object literal may only specify known properties, and 'File' does not exist in type 'Provider'. [ng] 18 providers: [StatusBar, SplashScreen, { provide: RouteReuseStrategy, useClass: IonicRouteStrategy, File, FileOpener }], [ng] ~~~~ [ng] Date: 2020-10-10T05:06:01.413Z - Hash: c963d31c2a4c95edc771 - Time: 8614ms
[INFO] Development server running!
Local: http://localhost:8100 Use Ctrl+C to quit this process[INFO] Browser window opened to http://localhost:8100!
Please suggest a work-around N Baua
