angular / angular/angularfire

Unable to provide getDatabase(): Error: AngularFireModule has not been provided at getSchedulers

未關閉
#2,999 4 則留言 7 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
7.8k
分支
2.2k
平均合併
22 小時 28 分鐘
30 天內合併 PR
6

描述

### Version info

**Angular:**
12.x.x

**Firebase:**
9.x.x

**AngularFire:**
7.x.x

**Other (e.g. Ionic/Cordova, Node, browser, operating system):**
Newly generated angular project with no SSR

### How to reproduce these conditions

**Failing test unit, Stackblitz demonstrating the problem**

Clone this repo and follow the README instructions

https://github.com/thatgirlcancode/angular-fire-issue

**Steps to set up and reproduce**

1. npm install
2. Add your Firebase environment config settings in app.module
3. Run ng serve or npm run start and Navigate to http://localhost:4200/
4. You will see in browser developer tools the error: Error: AngularFireModule has not been provided at getSchedulers

**Sample data and security rules**

### Debug output

** Errors in the JavaScript console **
`Error: AngularFireModule has not been provided at getSchedulers`

** Output from `firebase.database().enableLogging(true);` **
`undefined`

** Screenshots **

### Expected behavior

Firebase Realtime Database is configured and I'm able to use injection token in Firebase Service to query the database.

I have no issues configuring Firestore in this same way. I'm able to do this same provider/injection token pattern using `initializeApp` and `getFirestore` and it works beautifully. What is the difference with `getDatabase`?

### Actual behavior

`Error: AngularFireModule has not been provided at getSchedulers` is thrown and the web page is blank.

貢獻指南

開啟貢獻指南

研究方向

複製連結的重現儲存庫並依照其 README 操作,先從 app.module 中的 Firebase 設定以及使用 getDatabase 的服務開始。將該設定與正常運作的 Firestore 注入模式進行比較,並追蹤 getSchedulers 錯誤。產生的應用程式能在沒有 AngularFireModule 錯誤的情況下啟動,且可以透過注入權杖查詢 Firebase Realtime Database,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
angular, typescript
領域
database
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。