Reputation: 1
image of the project and files
I am trying to import firebase in my react app, using the following syntax:
import firebase from "firebase";
But I am facing following issue:
./src/firebase.js
Module not found: Can't resolve 'firebase' in '/Users/Desktop/reels/src'
commands i have ran on terminal:
npm i firebase
Also i have checked in the node modules firebase was there.
Upvotes: 0
Views: 325
Reputation: 78
I think you're using the ^9 version, so try this:
import firebase from 'firebase/compat/app'
Upvotes: 1
Reputation: 11
You should try this code
import { initializeApp } from "firebase/app";
import { getFirestore } from "firebase/firestore";
Upvotes: 1