const db=firebaseApp.firestore();
export default db;
错误发生在这行代码中。我尝试导入所有东西和每种可能的方法,但错误仍然会每次出现。
完整代码如下:
import * as firebase from "firebase/app";
//import firebase from 'firebase/app';
import "firebase/firestore";
import 'firebase/auth';
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseApp = firebase.initializeApp({
apiKey: "",
authDomain: "",
databaseURL: '',
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: "",
measurementId: ""
});
const db=firebaseApp.firestore();
export default db;