-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
blocked: customer-responseplatform: androidplugin: authenticationFirebase AuthenticationFirebase Authenticationtype: bugNew bug reportNew bug report
Description
Issue
Attempting to register a user using createUserWithEmailAndPassword
within an expo application consistently results in a TypeError when accessing the code property of the caught error object, specifically: [TypeError: Cannot read property 'code' of undefined]
. The problem only occurs on android and I can confirm that iOS works fine.
Describe your issue here
Project Files
Javascript
async registerUser(email: string, password: string) {
try {
const res = await createUserWithEmailAndPassword(getAuth(), email, password);
console.log('Response @ ', res);
return res;
} catch (e) {
console.log('error @ createUserWithEmailAndPassword: ', e);
const error = e as FirebaseAuthTypes.NativeFirebaseAuthError;
if (error.code === 'auth/invalid-email') {
throw new Error('Invalid email address');
}
else if (error.code === 'auth/email-already-in-use') {
throw new Error('Email address already in use. Try signing in.');
}
else if (error.code === 'auth/weak-password') {
throw new Error('Password is too weak. Try a stronger password.');
}
else {
throw new Error('An error occurred. Please try again later.');
}
}
}
package.json
:
{
"@react-native-firebase/analytics": "^23.4.0",
"@react-native-firebase/app": "^23.4.0",
"@react-native-firebase/app-check": "^23.4.0",
"@react-native-firebase/auth": "^23.4.0",
"@react-native-firebase/firestore": "^23.4.0",
"@react-native-firebase/in-app-messaging": "^23.4.0",
"@react-native-firebase/messaging": "^23.4.0",
"@react-native-firebase/perf": "^23.4.0",
}
firebase.json
for react-native-firebase v6:
# N/A
iOS
Click To Expand
ios/Podfile
:
- I'm not using Pods
- I'm using Pods and my Podfile looks like:
# N/A
AppDelegate.m
:
// N/A
Android
Click To Expand
Have you converted to AndroidX?
- my application is an AndroidX application?
- I am using
android/gradle.settings
jetifier=true
for Android compatibility? - I am using the NPM package
jetifier
for react-native compatibility?
android/build.gradle
:
// N/A
android/app/build.gradle
:
// N/A
android/settings.gradle
:
// N/A
MainApplication.java
:
// N/A
AndroidManifest.xml
:
<!-- N/A -->
Environment
Click To Expand
react-native info
output:
OUTPUT GOES HERE
- Platform that you're experiencing the issue on:
- iOS
- Android
- iOS but have not tested behavior on Android
- Android but have not tested behavior on iOS
- Both
react-native-firebase
version you're using that has this issue:v23.4.0
Firebase
module(s) you're using that has the issue:Auth
- Are you using
TypeScript
?Y
&5.9.2
- π Check out
React Native Firebase
andInvertase
on Twitter for updates on the library.
Metadata
Metadata
Assignees
Labels
blocked: customer-responseplatform: androidplugin: authenticationFirebase AuthenticationFirebase Authenticationtype: bugNew bug reportNew bug report