When I try to initialize Firebase Cloud Firestore, I ran into the following error:
Uncaught TypeError: WEBPACK_IMPORTED_MODULE_0_firebase.firestore is not a function
I installed firebase with npm install firebase --save
previously.
import * as firebase from 'firebase';
import router from '../router';
const config = {
apiKey: "a",
authDomain: "a",
databaseURL: "a",
projectId: "a",
storageBucket: "a",
messagingSenderId: "a"
};
if(!firebase.apps.length){
firebase.initializeApp(config);
let firestore = firebase.firestore();
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…