Having issues saving to firestore and subsequently retrieving that data. Below is a sample of the code that's failing. This code is pretty basic and my internet connection is fine. Upgrading to websdk 5.0.4 does not resolve issue either.
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);
}
};
In debug mode I see 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
data? maybe that object contains things with types that cannot be persisted to Firestore? 2. What are the security rules you have in place? - Ohad{name: '...', number: '...'}. What's even stranger is that realtime db is fine, auth is fine. Nothing in the config is different for the other services - Felix