Has anyone ran into troubles with firebase and its emulators? I keep getting the following error on hot reload.
FirebaseError: Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.
Initialisation:
// Initialize Firebase
const firebaseApp = initializeApp(firebaseConfig);
let mode = "emulate";
const auth = getAuth(firebaseApp);
const db = getFirestore(firebaseApp);
const storage = getStorage(firebaseApp);
const functions = getFunctions(firebaseApp);
if (mode === "emulate") {
connectAuthEmulator(auth, "http://localhost:9099");
connectFirestoreEmulator(db, "localhost", 8080);
connectStorageEmulator(storage, "localhost", 9199);
connectFunctionsEmulator(functions, "localhost", 5001);
}
export { firebaseApp, db, auth, storage, functions };