Unable to provide getDatabase(): Error: AngularFireModule has not been provided at getSchedulers
- 主要语言
- 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