Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular and firebase: Cannot find namespace 'firebase'

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>; 
like image 935
Ram2 Avatar asked Aug 07 '26 11:08

Ram2


2 Answers

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

like image 173
Melchia Avatar answered Aug 09 '26 01:08

Melchia


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

like image 40
KLTR Avatar answered Aug 09 '26 00:08

KLTR



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!