Closed Moh88CS closed 10 months ago
I'm not able to test on the web version. I'm getting an unmatched route error, caused by this:
TypeError: TypeError: (0 , _auth.getReactNativePersistence) is not a function
This is inherited from stage, where me and @stefanodongowski made the auth state persist. To use this with the web version, try using this version of the FirebaseConfig.tsx file where persistence is commented out:
import { initializeApp} from 'firebase/app';
import { getAuth, initializeAuth, getReactNativePersistence } from 'firebase/auth';
import { getFirestore } from 'firebase/firestore';
// import ReactNativeAsyncStorage from '@react-native-async-storage/async-storage';
const firebaseConfig = {
apiKey: process.env.EXPO_PUBLIC_API_KEY,
authDomain: process.env.EXPO_PUBLIC_AUTH_DOMAIN,
projectId: process.env.EXPO_PUBLIC_PROJECT_ID,
storageBucket: process.env.EXPO_PUBLIC_STORAGE_BUCKET,
messagingSenderId: process.env.EXPO_PUBLIC_MESSAGING_SENDER_ID,
appId: process.env.EXPO_PUBLIC_APP_ID
};
const FIREBASE_APP = initializeApp(firebaseConfig);
const FIREBASE_AUTH = getAuth(FIREBASE_APP);
// const FIREBASE_AUTH = initializeAuth(FIREBASE_APP, {
// persistence: getReactNativePersistence(ReactNativeAsyncStorage)
// });
const FIRESTORE = getFirestore(FIREBASE_APP);
export {FIREBASE_AUTH, FIRESTORE} ;
Thanks! I thought so, I've also been looking into how to troubleshoot this error. I'll try that.
I've also been trying to test on my phone, but when I launch the expo app, it sends me into my premade account that has an undefined role, so it won't load. Trying to find a workaround for testing purposes.
I believe this may be caused by our abrupt switch to persistence, where it remembers your old account. Can you try logging out from the app itself and log in again and see if that fixes it? In the case it won't load that page, I think you may need to temporarily remove persistence and clear cache.
Thanks! I was able to add a role manually in firestore so that I was able to bypass the error. Now, I'm able to test on iOS and web. The gameCard looks great in both versions! I just created an issue for the problems running on the web for us to debug that in the future.
Also, shoutout to whoever made the profile page functional!
I'm not able to test on the web version. I'm getting an unmatched route error, caused by this:
TypeError: TypeError: (0 , _auth.getReactNativePersistence) is not a function