Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 5 + Firebase: Namespace 'firebase.auth' has no exported member 'IdTokenResult'

I am currently work on web project using Angular 5 and I want to integrate the Firebase Cloud Messaging to send notification on app, bt I faced to a lot of problems that I tried to fix them. Right now there two errors that I'm not able to fix concerning: Namespace 'firebase.auth' and functions

The errors look like:

ERROR in node_modules/angularfire2/auth/auth.d.ts(12,45): error TS2694: Namespace 'firebase.auth' has no exported member 'IdTokenResult'.
node_modules/angularfire2/firebase.app.module.d.ts(2,42): error TS2305: Module '"/Users/gerardtalla/dev/workspaces/ws-parcaune/pms/pms-frontend-2018/node_modules/firebase/app/index"' has no exported member 'functions'.

How can I fix that? I'm using

Angular 5

"firebase": "4.8.0"

"angularfire2": "^5.0.0-rc.5"

"@angular/cli": "~1.7.3"

if someone has an idea do not hesitate please share with me. Thank a lot in advance.

like image 608
gerard talla Avatar asked Jun 05 '18 20:06

gerard talla


3 Answers

just use "angularfire2": "5.0.0-rc.5" instead of "angularfire2": "^5.0.0-rc.5"

like image 179
Marouan Avatar answered Sep 22 '22 11:09

Marouan


Run the following command:

npm i --save firebase@latest   angularfire2@latest
like image 29
Justice Selorm Bruce Avatar answered Sep 21 '22 11:09

Justice Selorm Bruce


It is version compatible issue, you can read AngularFirebase2 Changelog

5.0.0-rc.9 (2018-05-16)

auth: Adding user and idTokenResult Observables to AngularFireAuth (#1642) (31045a9)

like image 41
Haifeng Zhang Avatar answered Sep 22 '22 11:09

Haifeng Zhang