最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - angular and firebase: Cannot find namespace 'firebase' - Stack Overflow

programmeradmin1浏览0评论

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>; 

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>; 
Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Dec 26, 2017 at 16:18 Ram2Ram2 311 silver badge3 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 4

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

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

npm install [email protected] --save-dev

Update: 29-01-2018

This worked for me

发布评论

评论列表(0)

  1. 暂无评论