"No Firebase App '[DEFAULT]' has been created" when using " provideFirebaseApp(() => initializeApp(environment.firebase))," in app.module.ts imports array, getStorage()
- Langage dominant
- TypeScript
- Étoiles
- 7.8k
- Forks
- 2.2k
- Merge moyen
- 22 h 28 min
- PR mergées (30 j)
- 6
Description
### Version info
**Angular:**
^16.2.0
**Firebase:**
^10.4.0
**AngularFire:**
^7.6.1
**Other (e.g. Ionic/Cordova, Node, browser, operating system):**
### How to reproduce these conditions
**Steps to set up and reproduce**
Create Angular app via ng new appName, add Angularfire with ng add @angular/fire, initialize Firebase app in app.module.ts using the following in the imports array:
` provideFirebaseApp(() => initializeApp(environment.firebase)),
`
Then, integrate firebase app via environments (create with ng add environment if needed), add storage service that connects to storage bucket via getStorage()
### Debug output
ERROR Error: Uncaught (in promise): FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call initializeApp() first (app/no-app).
FirebaseError@http://localhost:4200/vendor.js:73648:5
create@http://localhost:4200/vendor.js:73676:19
getApp@http://localhost:4200/vendor.js:154432:25
getStorage@http://localhost:4200/vendor.js:72546:80
4886/ɵzoneWrap/
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Reproduisez le problème dans app.module.ts en utilisant provideFirebaseApp(() => initializeApp(environment.firebase)) et un service de stockage qui appelle getStorage(). Suivez l’ordre d’initialisation et d’accès au service indiqué par la trace de pile no-app de Firebase. C’est terminé lorsque le service de stockage fonctionne sans l’erreur de l’application par défaut.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, firebase, typescript
- Domaine
- cloud
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100