I am getting this error:
typeError:Cannot read properties of undefined (reading 'app')
How can I fix it?
import firebase from './firebase';
const firebaseConfig = {
apiKey: "My api key",
authDomain: "domain",
projectId: "project id",
storageBucket: "Bucket",
messagingSenderId: "SenderId",
appId: "my appid",
};
const app = !firebase.app.length
? firebase.initialzeApp(firebaseConfig)
: firebase.app();
const db = apps.firestore();
const auth = app.auth();
const provider = new firebase.auth.GoogleAuthProvider();
export {db, auth, provider}
...