Firebase JS SDK - createUserWithEmailAndPassword raising Exception

113 views
Skip to first unread message

Sandy Ludosky

unread,
Jan 16, 2023, 7:00:25 PM1/16/23
to Firebase Google Group
Whenever I try to create a new user, I keep getting this error: 

TypeError: Cannot read properties of undefined (reading 'then')

Is it a major bug ? the promise never  fulfills with the user object.
I am using Firebase "^9.15.0"

Screenshot 2023-01-16 at 18.29.31.png


Frank van Puffelen

unread,
Jan 16, 2023, 7:06:16 PM1/16/23
to Firebase Google Group
Works for me: https://stackblitz.com/edit/auth-v9

Code:
const auth = getAuth();
createUserWithEmailAndPassword(auth, "us...@domain.com", "CorrectHorseBatteryStaple").then((credentials)=> {
  console.log(credentials);
  console.log(credentials.user);
}).catch((err) => {
  console.error(err);
})

Logs:
Initializing Firebase
UserCredentialImpl {user: UserImpl, providerId: null, _tokenResponse: {…}, operationType: 'signIn'}
UserImpl {providerId: 'firebase', proactiveRefresh: ProactiveRefresh, reloadUserInfo: {…}, reloadListener: null, uid: '9X2qcCSN9vU4K2IhBSWExW3Hlix1', …}


If it continues to not work for you, please share a similar repro of the problem.



Reply all
Reply to author
Forward
0 new messages