How to initalize Firestore with custom Settings like ignoreUndefinedProperties: true #1540
Replies: 2 comments 1 reply
-
I found some information that might be useful here here: #154, https://vuefire.vuejs.org/guide/other-firebase-services.html#Nuxt. Currently, in my ~/plugins/firestore.client.ts, I have the following code: import { initializeFirestore } from 'firebase/firestore';
export default defineNuxtPlugin(() => {
const firebaseApp = useFirebaseApp();
const firestore = initializeFirestore(firebaseApp, {
experimentalForceLongPolling: true,
});
return {
provide: {
firestore,
},
};
}); And use it as |
Beta Was this translation helpful? Give feedback.
-
Without Nuxt, you can simply use the Firebase SDK to setup anything needed directly. Since it automatically initializes the first time it's used (e.g. in a component), do it before mounting. In Nuxt, it cannot be achieved well yet because this feature was added later and there haven't been time to be added yet |
Beta Was this translation helpful? Give feedback.
-
The traditional way to do this is as follows, but it doesn't work as vuefire already initialized firestore with different settings.
Beta Was this translation helpful? Give feedback.
All reactions