'I am trying to include firebase into my react.js project. in order to create a login ApI .Below is my code
import { initializeApp } from "firebase/app";
import { getStorage } from "firebase/storage";
import { getAuth, GoogleAuthProvider } from "firebase/auth";
import { getFirestore } from "firebase/firestore/lite "
const firebaseConfig = {
apiKey: "AIzaSyATcQBcBVJAYZbn9EfKNq6DjXtFdx25tss",
authDomain: "grey-hackbu.firebaseapp.com",
projectId: "grey-hackbu",
storageBucket: "grey-hackbu.appspot.com",
messagingSenderId: "748662363480",
appId: "1:748662363480:web:4faf4f4fcd12e0f20d012d",
measurementId: "G-7GDWG2D6FF",
};
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
const auth = getAuth();
const storage = getStorage(app);
const provider = new GoogleAuthProvider();
export { db, auth, storage, provider };
But I keep having this issue " ERROR in ./src/firebase.js 6:0-56
Module not found: Error: Package path ./firestore/lite is not exported from package C:\Users\USA\disney-clone-plus\disney-clone\disney-clone-plus\node_modules\firebase (see exports field in C:\Users\USA\disney-clone-plus\disney-clone\disney-clone-plus\node_modules\firebase\package.json)
ERROR in ./src/firebase.js 16:12-25
export 'initializeApp' (imported as 'initializeApp') was not found in 'firebase/app' (module has no exports)
ERROR in ./src/firebase.js 18:13-20
export 'getAuth' (imported as 'getAuth') was not found in 'firebase/auth' (module has no exports)
ERROR in ./src/firebase.js 19:16-26
export 'getStorage' (imported as 'getStorage') was not found in 'firebase/storage' (module has no exports)
ERROR in ./src/firebase.js 20:21-39
export 'GoogleAuthProvider' (imported as 'GoogleAuthProvider') was not found in 'firebase/auth' (module has no exports)" . I would really appreciate if anybody can help
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
