1

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";

0

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.