Closed butri71 closed 11 months ago
Closing this since problem is not occurring any more since this morning
This seems like a syntax error to me as the .then
clause isn't attached to a promise. You mentioned that this isn't a problem anymore and that you meant to close this issue. I'm going to close it for now, but if there's another problem then please create a new issue and link to this one for context if needed. Thanks!
Operating System
react native 0.71.14 - expo sdk 48 - Node JS v18.17.1
Browser Version
Using iPhone 13Pro as testing device on Expo Go app
Firebase SDK Version
9.21.0
Firebase SDK Product:
Auth
Describe your project's tooling
React Native app using Expo managed service. Firebase Authentication by SignUp with Email and Password to read/write data on Firebase Realtime Database
Describe the problem
I've been using the following same code setup for the past 2 years without a single issue. I use the firebase/auth library to authenticate the user to access data stored in Realtime Database and then carry out my usual read/write operation.
When trying to authenticate the user using
signInWithEmailAndPassword
I get an errorCannot read property 'then' of undefined
The problem appeared the first time 20 hours ago since posting this issue here. It started intermittently and then it completely stopped working. I'm using the same authentication functionality across my code in various functions and it fails everywhere therefore not related issue on specific function.
The username and password are correctly passed and validated and showing correctly in console.log and I believe the issue is around the auth parameter
Steps and code to reproduce issue
1)
firebase.js
is the firebase config files 2)main.js
is a typical function that I call to write a new post rating into my Realtime Database. 3) When I calladdRating
I try first to authenticate my user in firebase before submitting a change 4) The usualsignInWithEmailAndPassword
now fails onauth
Error: Cannot read property 'then' of undefined
The logs are showing the following:
Whenever I use
*
it means it's returning the correct values as expected, just masking sensitive data. My understanding that the failures point is in .then((userCredential) in fact it doesn't go any further in showing theconsole.log('userCredential: ',userCredential)
Basically userCredential is now undefined every time for some reason.