Cordova-plugin-firebase: Ionic V4 error: ERROR in node_modules/@ionic-native/firebase/index.d.ts(2,10): error TS2305:

Created on 27 Jul 2018  路  6Comments  路  Source: arnesson/cordova-plugin-firebase

[ng] ERROR in node_modules/@ionic-native/firebase/index.d.ts(2,10): error TS2305: Module '"/node_modules/rxjs/Observable"' has no exported member 'Observable'.
[ng] node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.

npm version 6.2.0
ionic version 4.0.1

Most helpful comment

This error is caused, because when you add plugins from ionic native, it fetches that latest stable version which does not work with the latest ionic 4 beta version.
So you need to add the corresponding beta version for ionic native as well. So you need to run this:

1. npm install @ionic-native/[email protected]
2. npm install @ionic-native/[email protected]

Then other important thing is to note that for angular the import of ionic native plugins in app module also has changed, so you will have to make the following change in you app.module:

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

(Note the ngx at the end, this has to be done for all native plugins from now on)

Then it should run fine. Hope this helps! 馃憤

All 6 comments

This error is caused, because when you add plugins from ionic native, it fetches that latest stable version which does not work with the latest ionic 4 beta version.
So you need to add the corresponding beta version for ionic native as well. So you need to run this:

1. npm install @ionic-native/[email protected]
2. npm install @ionic-native/[email protected]

Then other important thing is to note that for angular the import of ionic native plugins in app module also has changed, so you will have to make the following change in you app.module:

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

(Note the ngx at the end, this has to be done for all native plugins from now on)

Then it should run fine. Hope this helps! 馃憤

@onkar0777 thanks for the update, I'm still getting a compile error. Any idea's?

[ng] ERROR in src/app/app.module.ts(8,26): error TS2307: Cannot find module '@ionic-native/firebase**/ngx**'.

I would guess that you did not run npm install @ionic-native/[email protected]

Also I am not sure what is ** in @ionic-native/firebase/ngx

closing as resolved

this error still appearing with ionic-native/admob 4.20.0 and ionic-native/core 5.2.0
when doing:
$ ionic cordova plugin add cordova-admob
$ npm install --save @ionic-native/admob@4

ERROR in node_modules/@ionic-native/admob/index.d.ts(2,10): error TS2305: Module '"/Users/flavio/Quizionic4/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.

this error still appearing with ionic-native/admob 4.20.0 and ionic-native/core 5.2.0
when doing:
$ ionic cordova plugin add cordova-admob
$ npm install --save @ionic-native/admob@4

ERROR in node_modules/@ionic-native/admob/index.d.ts(2,10): error TS2305: Module '"/Users/flavio/Quizionic4/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.

npm install --save rxjs-compat
As Rxjs is required for Angular 6 using in Ionic 4.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LKruglov picture LKruglov  路  4Comments

stephan-nordnes-eriksen picture stephan-nordnes-eriksen  路  5Comments

DanielAccorsi picture DanielAccorsi  路  3Comments

ghost picture ghost  路  3Comments

arunkatariaoodles picture arunkatariaoodles  路  4Comments