Working on a login form for Firebase auth.
When I do it with async await:
async function doLogin(email,password) {
setLoading(true);
try {
const userCredential = await firebase.auth().signInWithEmailAndPassword(email, password);
console.log(userCredential);
}
catch(err) {
console.log(err);
}
}
When the code above throws a login error, I get two duplicate error messages logged, and one of them is uncaught. And the uncaught one is from auth.esm.js:67
When I do it with a .then().catch()
async function doLogin(email,password) {
setLoading(true);
firebase.auth().signInWithEmailAndPassword(email, password)
.then((user) => console.log(user))
.catch((err) => console.log(err));
}
I get only one error message. The one from my code, which is the intended behavior.
QUESTION
Am I doing something wrong in the async await version? Shouldn't it be working just the same? Why is Firebase throwing the uncaught error?

