Skip to content Skip to sidebar Skip to footer

Firebase Auth Is Giving Me An Error When Trying To Resolve A Promise

I need help with this Google Auth Function… I have a method doCreateUserWithEmail and password in firebase.js (React) that looks like this. doCreateUserWithEmailAndPassword = (em

Solution 1:

You aren't returning anything from doCreateUserWithEmailAndPassword so it returns undefined and calling .then() on undefined causes the error you are seeing.

Just return the Promise from doCreateUserWithEmailAndPassword and that should fix it:

doCreateUserWithEmailAndPassword = (email, password) => {
  returnthis.auth
    .createUserWithEmailAndPassword(email, password)
    .then(response =>console.log(response))
    .catch(err =>console.log(err));
};

Post a Comment for "Firebase Auth Is Giving Me An Error When Trying To Resolve A Promise"