"No Firebase App '[DEFAULT]' has been created" when using " provideFirebaseApp(() => initializeApp(environment.firebase))," in app.module.ts imports array, getStorage()
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- angular, firebase, typescript
- Ambito
- cloud
Direzione di ricerca
Riproduci il problema in app.module.ts usando provideFirebaseApp(() => initializeApp(environment.firebase)) e un servizio di storage che chiama getStorage(). Traccia l’ordine di inizializzazione e accesso al servizio mostrato dallo stack trace no-app di Firebase. Il lavoro è completato quando il servizio di storage funziona senza l’errore dell’app predefinita.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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/</ret<@http://localhost:4200/vendor.js:1279:44
4886/runOutsideAngular/<@http://localhost:4200/vendor.js:1211:57
invoke@http://localhost:4200/polyfills.js:8209:158
run@http://localhost:4200/polyfills.js:7994:35
runOutsideAngular@http://localhost:4200/vendor.js:108406:24
runOutsideAngular@http://localhost:4200/vendor.js:1211:33
4886/ɵzoneWrap/<@http://localhost:4200/vendor.js:1279:34
StorageService@http://localhost:4200/main.js:914:85
StorageService_Factory@http://localhost:4200/main.js:918:12
1699/hydrate/<@http://localhost:4200/vendor.js:106890:33
runInInjectorProfilerContext@http://localhost:4200/vendor.js:98413:5
hydrate@http://localhost:4200/vendor.js:106889:37
get@http://localhost:4200/vendor.js:106769:23
get@http://localhost:4200/vendor.js:111362:32
lookupTokenUsingModuleInjector@http://localhost:4200/vendor.js:102129:31
getOrCreateInjectable@http://localhost:4200/vendor.js:102175:10
ɵɵdirectiveInject@http://localhost:4200/vendor.js:109230:38
ProductsComponent_Factory@http://localhost:4200/main.js:640:211
getNodeInjectable@http://localhost:4200/vendor.js:102369:38
createRootComponent@http://localhost:4200/vendor.js:111603:48
create@http://localhost:4200/vendor.js:111470:19
createComponent@http://localhost:4200/vendor.js:121503:43
activateWith@http://localhost:4200/vendor.js:145921:31
activateRoutes@http://localhost:4200/vendor.js:146519:28
7947/activateChildRoutes/<@http://localhost:4200/vendor.js:146473:12
activateChildRoutes@http://localhost:4200/vendor.js:146472:25
activate@http://localhost:4200/vendor.js:146383:10
7947/activateRoutes/<@http://localhost:4200/vendor.js:146367:120
9736/map/</<@http://localhost:4200/vendor.js:82387:31
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
3738/tap/</<@http://localhost:4200/vendor.js:83039:18
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
9736/map/</<@http://localhost:4200/vendor.js:82387:18
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
1891/switchMap/</</innerSubscriber<@http://localhost:4200/vendor.js:82897:243
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
9736/map/</<@http://localhost:4200/vendor.js:82387:18
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
384/fromArrayLike/<@http://localhost:4200/vendor.js:81823:18
_trySubscribe@http://localhost:4200/vendor.js:80744:19
2235/subscribe/<@http://localhost:4200/vendor.js:80738:113
errorContext@http://localhost:4200/vendor.js:83975:5
subscribe@http://localhost:4200/vendor.js:80733:69
9736/map/<@http://localhost:4200/vendor.js:82386:12
4114/operate/</<@http://localhost:4200/vendor.js:84264:18
2235/subscribe/<@http://localhost:4200/vendor.js:80738:42
errorContext@http://localhost:4200/vendor.js:83975:5
subscribe@http://localhost:4200/vendor.js:80733:69
1891/switchMap/</<@http://localhost:4200/vendor.js:82897:100
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
1891/switchMap/</</innerSubscriber<@http://localhost:4200/vendor.js:82897:243
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
9736/map/</<@http://localhost:4200/vendor.js:82387:18
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
1527/take/</<@http://localhost:4200/vendor.js:82932:20
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
728/defaultIfEmpty/</<@http://localhost:4200/vendor.js:82177:20
5678/OperatorSubscriber/this._complete<@http://localhost:4200/vendor.js:82050:9
complete@http://localhost:4200/vendor.js:81135:12
384/fromArrayLike/<@http://localhost:4200/vendor.js:81825:16
_trySubscribe@http://localhost:4200/vendor.js:80744:19
2235/subscribe/<@http://localhost:4200/vendor.js:80738:113
errorContext@http://localhost:4200/vendor.js:83975:5
subscribe@http://localhost:4200/vendor.js:80733:69
728/defaultIfEmpty/<@http://localhost:4200/vendor.js:82172:12
4114/operate/</<@http://localhost:4200/vendor.js:84264:18
2235/subscribe/<@http://localhost:4200/vendor.js:80738:42
errorContext@http://localhost:4200/vendor.js:83975:5
subscribe@http://localhost:4200/vendor.js:80733:69
1527/take/<@http://localhost:4200/vendor.js:82930:12
4114/operate/</<@http://localhost:4200/vendor.js:84264:18
2235/subscribe/<@http://localhost:4200/vendor.js:80738:42
errorContext@http://localhost:4200/vendor.js:83975:5
subscribe@http://localhost:4200/vendor.js:80733:69
9736/map/<@http://localhost:4200/vendor.js:82386:12
4114/operate/</<@http://localhost:4200/vendor.js:84264:18
2235/subscribe/<@http://localhost:4200/vendor.js:80738:42
errorContext@http://localhost:4200/vendor.js:83975:5
subscribe@http://localhost:4200/vendor.js:80733:69
1891/switchMap/</<@http://localhost:4200/vendor.js:82897:100
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
1891/switchMap/</</innerSubscriber<@http://localhost:4200/vendor.js:82897:243
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
9736/map/</<@http://localhost:4200/vendor.js:82387:18
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
3738/tap/</<@http://localhost:4200/vendor.js:83039:18
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
1891/switchMap/</</innerSubscriber<@http://localhost:4200/vendor.js:82897:243
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
3738/tap/</<@http://localhost:4200/vendor.js:83039:18
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
8164/mergeInternals/doInnerSub/<@http://localhost:4200/vendor.js:82471:20
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
8164/mergeInternals/doInnerSub/<@http://localhost:4200/vendor.js:82471:20
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
384/fromArrayLike/<@http://localhost:4200/vendor.js:81823:18
_trySubscribe@http://localhost:4200/vendor.js:80744:19
2235/subscribe/<@http://localhost:4200/vendor.js:80738:113
errorContext@http://localhost:4200/vendor.js:83975:5
subscribe@http://localhost:4200/vendor.js:80733:69
doInnerSub@http://localhost:4200/vendor.js:82466:95
outerNext@http://localhost:4200/vendor.js:82461:52
5678/OperatorSubscriber/this._next<@http://localhost:4200/vendor.js:82034:15
next@http://localhost:4200/vendor.js:81119:12
7344/takeLast/</<@http://localhost:4200/vendor.js:82968:20
5678/OperatorSubscriber/this._complete<@http://localhost:4200/vendor.js:82050:9
Expected behavior
Storage service should work fine. It should not be possible for any component or module to access the firebase app before its created when its initialized in the app.module.ts imports array.
Actual behavior
Storage service causes Firebase error "ERROR Error: Uncaught (in promise): FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call initializeApp() first (app/no-app)."
- Lingua principale
- TypeScript
- Stelle
- 7.8k
- Fork
- 2.2k
- Merge medio
- 3g 6h
- PR unite (30g)
- 5
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di angular/angularfire
-
comp: build/pipeline type: bug version: current (v17+)
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
angular/angularfire#3766 ·
-
comp: schematics type: bug version: current (v17+)
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
angular/angularfire#3768 ·
-
comp: docs type: chore version: current (v17+)
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
angular/angularfire#3764 ·
-
comp: firestore comp: ssr priority: P0 (critical) type: feature version: current (v17+)
angular/angularfire#3757 · 1 assegnatario ·
-
Six `firebase` entry points have no `@angular/fire` equivalent, so their exports are unreachable Apertacomp: core type: feature
angular/angularfire#3755 · 1 assegnatario ·
Tutte le issue di angular/angularfire
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
bug v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
modelcontextprotocol/inspector#2458 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
carbon-design-system/ibm-products#9907 ·