I am getting the following Error message: ./src/firebase.js Module not found: Can't resolve I 'firebase'
I am using firebase version [email protected]
Command in firebase.js import firebase from "from firebase";
I am getting the following Error message: ./src/firebase.js Module not found: Can't resolve I 'firebase'
I am using firebase version [email protected]
Command in firebase.js import firebase from "from firebase";
In the 9.x version of the SDK you no longer can import the entire firebase object, but instead import individual functions. For more on this see the Firebase documentation on adding Firebase to your web app, which shows this as the starting point:
import { initializeApp } from 'firebase/app'; // TODO: Replace the following with your app's Firebase project configuration const firebaseConfig = { //... }; const app = initializeApp(firebaseConfig); Alternatively you can keep using the older call style with the latest SDK, by using its compat imports:
// v9 compat packages are API compatible with v8 code import firebase from 'firebase/compat/app'; I also recommend checking out the documentation on upgrading to the modular SDK, as most tutorials on others sites are likely going to be using the older style calls.