Firebase is not assignable as provider in app.module.ts

#1

I have started a new blank ionic app and have tried to integrate Firebase for push notifications but am getting an error when trying to set Firebase as a provider.

I have installed Firebase according to the docs, i.e:

ionic cordova plugin add cordova-plugin-firebase
npm install --save @ionic-native/firebase

and my app.module.ts is

but I get an error

[ts]
Type 'FirebaseOriginal' is not assignable to type 'Provider'.
  Type 'FirebaseOriginal' is missing the following properties from type 'FactoryProvider': provide, useFactory [2322]
(alias) const Firebase: FirebaseOriginal
import Firebase

I have tried ionic 3 and 4 and the same error occurs.

Help much appreciated.

2 Likes
#2

You should import the ngx folder for the ionic-native Firebase module, like this:

import { Firebase } from '@ionic-native/firebase/ngx';

This is not available in any documentation of the module.

6 Likes