'How to solve this error: 'Firebase' is not defined
I'm trying to use firebase on react, but I'm getting the " 'firebase' is not defined " error. I installed firebase, and I have the firebase configuration on another file that I import on the code. The firebaseConfig.
My code
import { initializeApp } from 'firebase/app';
import { firebaseConfig } from "./config";
import 'firebase/auth';
import 'firebase/firestore';
const app = initializeApp(firebaseConfig);
const auth = auth(firebase.auth);
const firestore = firestore(firebase.firestore);
const GoogleProvider = new firebase.auth.GoogleAuthProvider();
GoogleProvider.setCustomParameters({ prompt: 'select_account' });
export const signInWithGoogle = () => auth.signInWithPopup();
Solution 1:[1]
You can try write npm install -g firebase-tools in your terminal project
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | IlCorsaroNero |
