Javascript Angular Application中当前未初始化任何firebase.app.app实例

Javascript Angular Application中当前未初始化任何firebase.app.app实例,javascript,angular,firebase,firebase-authentication,Javascript,Angular,Firebase,Firebase Authentication,我在web应用程序中使用firebase mobile Authentication,当我使用recaptchaVerifier时,当recaptchaVerifier未显示且出现此错误时,我正在项目中使用实时数据库,该数据库工作正常,但不知道为什么mobile Authentication模块不工作 应用程序模块.ts import { environment } from './../environments/environment'; ngOnInit() { this.window

我在web应用程序中使用firebase mobile Authentication,当我使用recaptchaVerifier时,当recaptchaVerifier未显示且出现此错误时,我正在项目中使用实时数据库,该数据库工作正常,但不知道为什么mobile Authentication模块不工作 应用程序模块.ts

import { environment } from './../environments/environment';
ngOnInit() {


this.windowRef = this.win.windowRef
this.windowRef.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container')

this.windowRef.recaptchaVerifier.render()
进口:[ AngularFireModule.initializeApp(environment.firebaseConfig)]

组件模块.ts

import { environment } from './../environments/environment';
ngOnInit() {


this.windowRef = this.win.windowRef
this.windowRef.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container')

this.windowRef.recaptchaVerifier.render()
}


请帮我解决这个问题

您需要使用initializeApp方法初始化firebase实例

在组件的ngOnInit()函数中,在创建RecaptchaVerifier之前添加以下行

firebase.initializeApp(config);
this.windowRef.recaptchaVerifier.render()