Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#3,443 21 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Reproduce el problema en app.module.ts usando provideFirebaseApp(() => initializeApp(environment.firebase)) y un servicio de almacenamiento que llame a getStorage(). Rastrea el orden de inicialización y acceso al servicio mostrado por el stack trace no-app de Firebase. Se considera terminado cuando el servicio de almacenamiento funciona sin el error de la aplicación predeterminada.

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

Descripción

comp: storage needs: investigation type: bug version: legacy (v7-v16)
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)."

Lenguaje dominante
TypeScript
Estrellas
7.8k
Forks
2.2k
Merge medio
3 d 6 h
PR fusionados (30 d)
5

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de angular/angularfire

Todos los issues de angular/angularfire

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.