angular / angular/angularfire

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

Đang mở
#2,999 4 bình luận 7 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
7.8k
Fork
2.2k
Merge trung bình
22 giờ 28 phút
Pull request đã merge (30 ngày)
6

Mô tả

### 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Clone repository tái hiện được liên kết và làm theo README của repository đó, bắt đầu với cấu hình Firebase trong app.module và service sử dụng getDatabase. So sánh thiết lập đó với mẫu injection Firestore đang hoạt động và truy vết lỗi getSchedulers. Công việc được hoàn tất khi ứng dụng được tạo khởi động mà không có lỗi AngularFireModule và có thể truy vấn Firebase Realtime Database thông qua injection token.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
database
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.