This error happens when attempting to store data into firestore. I’m following the example so I’m not sure what’s causing issue.
const db = getFirestore(app);
console.log('db', db)
const docRef = doc(db, 'users', userCredential.user.uid);
console.log('docref', docRef)
await setDoc(docRef, inputs);
the const docRef = doc(db, 'users', userCredential.user.uid);
specifcally is what’s causing the error,
Looking at another post, I’m not sure if my config file may be the issue:
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
export const firebaseConfig = {
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
// Initialize Firebase Authentication and get a reference to the service
export const auth = getAuth(app);
export default app ;
Recognized by Google Cloud Collective
5
My firebase config file was the problem.
I removed export default app and changed it to the following.
export { app };