angular / angular/angularfire

"No Firebase App '[DEFAULT]' has been created" when using " provideFirebaseApp(() => initializeApp(environment.firebase))," in app.module.ts imports array, getStorage()

Offen
#3,443 21 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
comp: storage needs: investigation type: bug version: legacy (v7-v16)
Vorherrschende Sprache
TypeScript
Sterne
7.8k
Forks
2.2k
Ø Merge
22 Std. 28 Min.
Gemergte PRs (30 T.)
6

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Reproduziere das Problem in app.module.ts mit provideFirebaseApp(() => initializeApp(environment.firebase)) und einem Storage-Service, der getStorage() aufruft. Verfolge die im Firebase-no-app-Stacktrace dargestellte Reihenfolge der Initialisierung und des Servicezugriffs. Erledigt ist die Aufgabe, wenn der Storage-Service ohne den Default-App-Fehler funktioniert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, firebase, typescript
Bereich
cloud
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.