Unable to provide getDatabase(): Error: AngularFireModule has not been provided at getSchedulers
- Linguagem predominante
- TypeScript
- Estrelas
- 7.8k
- Forks
- 2.2k
- Merge médio
- 22h 28min
- PRs com merge (30d)
- 6
Descrição
### 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.
Guia de contribuição
Direção de pesquisa
Clone o repositório de reprodução vinculado e siga o README dele, começando pela configuração do Firebase em app.module e pelo serviço que usa getDatabase. Compare essa configuração com o padrão funcional de injeção do Firestore e rastreie o erro getSchedulers. A tarefa estará concluída quando o aplicativo gerado iniciar sem o erro AngularFireModule e o Firebase Realtime Database puder ser consultado por meio do token de injeção.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- angular, typescript
- Domínio
- database
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 48/100