angular / angular/angularfire

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

未关闭
#3,443 21 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
comp: storage needs: investigation type: bug version: legacy (v7-v16)
主要语言
TypeScript
星标
7.8k
派生
2.2k
平均合并
22 小时 28 分钟
30 天内合并 PR
6

描述

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

贡献指南

打开贡献指南

调研方向

在 app.module.ts 中使用 provideFirebaseApp(() => initializeApp(environment.firebase)),并使用一个调用 getStorage() 的存储服务来复现该问题。跟踪 Firebase no-app 堆栈跟踪中显示的初始化和服务访问顺序。当存储服务能够正常工作且不出现 default-app 错误时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, firebase, typescript
领域
cloud
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。