angular / angular/angularfire

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

Abierto
#2,999 4 comentarios 7 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
7.8k
Forks
2.2k
Merge medio
22 h 28 min
PR fusionados (30 d)
6

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Clone el repositorio de reproducción vinculado y siga su README, comenzando por la configuración de Firebase en app.module y el servicio que usa getDatabase. Compare esa configuración con el patrón de inyección de Firestore que funciona y rastree el error de getSchedulers. La tarea estará terminada cuando la aplicación generada se inicie sin el error de AngularFireModule y se pueda consultar Firebase Realtime Database mediante el token de inyección.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
database
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.