user4717644
user4717644

Reputation:

Firebase Phone Auth - RecaptchaVerifier Type Error

I am trying to implement Firebase Phone Number Authentication as described Here

However when I try try and create the RecaptchaVerifier object as per the docs:

window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container');

I get the following error:

Uncaught TypeError: Cannot read property 'bind' of undefined at new FirebaseAppImpl.(anonymous function)

which seems to be from this line of code in the Firebase SDK:

 var serviceFxn = this._getService.bind(this, name);

Has anyone successfully implemented this?

Upvotes: 0

Views: 4380

Answers (1)

user4717644
user4717644

Reputation:

I was wrongly trying to create the RecaptchaVerifier on the already initialised FirebaseApp rather than the actual module. This code is actually working fine:

window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('recaptcha-container');

Upvotes: 2

Related Questions