2

I am getting the below error while working with angular and firebase:

Typescript Error

Cannot find namespace 'firebase'.

C:/Users/DELL/Desktop/connect/withfire/node_modules/angularfire2/auth/auth.d.ts

 app: FirebaseApp; 
 readonly auth: firebase.auth.Auth; 
 readonly authState: Observable<firebase.User | null>; 

4 Answers 4

4

You need to downgrade firebase version. Try this: $ npm install -s [email protected]

Sign up to request clarification or add additional context in comments.

Comments

4

4.8.1 was a refactor of the typings and you now pull your imports from @firebase:

import { FirebaseApp } from '@firebase/app-types';
import { FirebaseAuth } from '@firebase/auth-types';
import { FirebaseDatabase } from '@firebase/database-types';
import { FirebaseMessaging } from '@firebase/messaging-types';
import { FirebaseStorage } from '@firebase/storage-types';
import { FirebaseFirestore } from '@firebase/firestore-types';

import what ever module you need

Comments

2

npm install [email protected] --save-dev

Comments

1

Update: 29-01-2018

This worked for me 👍

  "angularfire2": "5.0.0-rc.6",
  "firebase": "4.8.2",

Note: Don't forget to delete node_modules folder and npm i.

1 Comment

Glad to hear that it helped :) @Jared

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.