No provider for File


#1

I know the first thing you’re going to say is that I need to add File as provider in app.module.ts, but I have done that.

I have imported File: import { File } from ‘@ionic-native/file’

I have added it to the providers in app.module.ts:
providers: [File, {provide: ErrorHandler, useClass: IonicErrorHandler}, BrandData]

The cordova plugin is installed

It’s in package.json:
"@ionic-native/file": “^4.3.3”

The specific error is:
Uncaught (in promise): Error: No provider for File! Error: No provider for File! at injectionError (http://localhost:8100/build/vendor.js:1661:90) at noProviderError

Seemed to start happening when I added vendor.js to my index.html after upgrading.


#2

Ugh! User error! I found an erroneous ref to File and the error was being thrown for there, not where I thought. This is closed.