NativeScript / NativeScript/firebase
[firebase-core]: Unable to Initialize Firebase App
未关闭
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 62
- 派生
- 53
- 平均合并
- 8 天 4 小时
- 30 天内合并 PR
- 2
描述
Hello Team,
Can you assist with the error below, when trying to initialize the firebase app from the firebase-core?
Here is how I am initializing it
export class AppComponent implements OnInit {
ngOnInit(): void {
firebase().initializeApp().then((app) => {
console.log(app);
})
}
}
Here is the error that shows up
JS: Error: Cannot read property 'FirebaseApp' of undefined
JS: at file: src/webpack:/testapp/node_modules/@nativescript/firebase-core/index.android.js:295:0
JS: at new ZoneAwarePromise (file: src/webpack:/testapp/node_modules/zone.js/fesm2015/zone.js:1429:0)
JS: at Firebase.initializeApp (file: src/webpack:/testapp/node_modules/@nativescript/firebase-core/index.android.js:234:0)
JS: at AppComponent.ngOnInit (file: src/webpack:/testapp/src/app/app.component.ts:6:16)
JS: at callHook (file: src/webpack:/testapp/node_modules/@angular/core/fesm2015/core.mjs:2491:0)
JS: at callHooks (file: src/webpack:/testapp/node_modules/@angular/core/fesm2015/core.mjs:2460:0)
JS: at executeInitAndCheckHooks (file: src/webpack:/testapp/node_modules/@angular/core/fesm2015/core.mjs:2411:0)
JS: at refreshView (file: src/webpack:/testapp/node_modules/@angular/core/fesm2015/core.mjs:11971:0)
JS: at detectChangesInternal (file: src/webpack:/testapp/node_modules/@angular/core/fesm2015/core.mjs:13174:0)
JS: at RootViewRef.detectChanges (file:///data/data/org.nativescript.testapp/fi...
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先复现 src/app/app.component.ts 中的初始化,并检查 node_modules/@nativescript/firebase-core/index.android.js 中失败的 Firebase.initializeApp 路径,尤其是报告的 FirebaseApp 访问。追踪 Android 特定的失败之前,先检查项目的 NativeScript 和 Firebase 设置。应用能够成功初始化且不再出现报告的 undefined FirebaseApp 错误,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- angular, firebase, typescript
- 领域
- backend, mobile
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 20/100