I am building an app using react native, I use firebase as my database. Everything was working fine. I started running the app on my device through Xcode. It worked but now I get this warning on my device and simulator which prevents me from getting data from firebase database. the warning is
"Possible Unhandled Promise Rejection (id: 20): TypeError: _util.base64.tI is not a function. (In '_util.base64.tI(t, !1)', '_util.base64.tI' is undefined)"
I don't know where did this (_util.base64) come from. I guess the problem has to do with this code part (the promise) as when I remove this part it works fine but unable to get data without it. can anyone help?
useEffect(() => {
db.collection("Appointments")
.orderBy("Timing", "desc")
.limit(2)
.get()
.then((querySnapshot) => {
const list = [];
querySnapshot.forEach((doc) => {
const { Speciality, Date, TimeSlot } = doc.data();
list.push({
id: doc.id,
Speciality,
Date,
TimeSlot,
});
});
setAppointments(list);
})
.catch((error) => {
alert(error.message);
console.log(error);
});
}, []);