Encountering difficulties when attempting to save and retrieve data from firestore. The code snippet provided below is failing, despite its simplicity and my stable internet connection. Even upgrading to websdk 5.0.4 has not fixed the issue.
save = async (data: any) => {
try {
const { id, ...rest } = data;
await db
.collection('/customers')
.doc(id)
.set({ ...rest });
const saved = await db
.collection('/customers')
.doc(data.id)
.get();
console.log(saved.data());
} catch (error) {
console.log(error);
}
};
Upon debugging, I noticed the following:
[2018-05-28T13:09:19.910Z] @firebase/firestore: Firestore (5.0.3) [PersistentStream]: close with error: FirebaseError: [code=unknown]: Fetching auth token failed: Cannot redefine property: _lat index.esm.js:65 [2018-05-28T13:09:19.915Z] @firebase/firestore: Firestore (5.0.3) [ExponentialBackoff]: Backing off for 46014.29558926278 ms (base delay: 60000 ms) index.esm.js:65 [2018-05-28T13:10:06.122Z] @firebase/firestore: Firestore (5.0.3) [PersistentStream]: close with error: FirebaseError: [code=unknown]: Fetching auth token failed: Cannot redefine property: _lat