I'm working on a project on react and this is my first time using firebase. I have set up my firebase config file in my app. I keep getting an error message (shown below) when I import db from my firebase.config.js file.
error message: export 'getFireStore' (imported as 'getFireStore') was not found in 'firebase/firestore'
my code:
enter code here
import { initializeApp } from 'firebase/app'
import { getFireStore } from 'firebase/firestore'
// Your web app's Firebase configuration
const firebaseConfig = {
// ...
}
// Initialize Firebase
const app = initializeApp(firebaseConfig)
export const db = getFireStore()
CodePudding user response:
import firebase from "firebase/app";
import "firebase/firestore";
import "firebase/auth";
firebase.initializeApp({
});
const auth = firebase.auth();
const firestore = firebase.firestore();
export { auth, firestore };
TRY THIS CODE
CodePudding user response:
did you install the package firebase using
npm install firebase