Unable to provide getDatabase(): Error: AngularFireModule has not been provided at getSchedulers
- Vorherrschende Sprache
- TypeScript
- Sterne
- 7.8k
- Forks
- 2.2k
- Ø Merge
- 22 Std. 28 Min.
- Gemergte PRs (30 T.)
- 6
Beschreibung
### 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.
Beitragsleitfaden
Rechercherichtung
Klonen Sie das verknüpfte Reproduktions-Repository und folgen Sie dessen README. Beginnen Sie mit der Firebase-Konfiguration in app.module und dem Dienst, der getDatabase verwendet. Vergleichen Sie diese Einrichtung mit dem funktionierenden Firestore-Injektionsmuster und verfolgen Sie den getSchedulers-Fehler zurück. Erledigt ist die Aufgabe, wenn die generierte App ohne den AngularFireModule-Fehler startet und die Firebase Realtime Database über das Injection-Token abgefragt werden kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, typescript
- Bereich
- database
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100