我正在尝试使用firestore创建一个简单的web应用程序。由于某种原因,我出现了上述错误。有人能解释一下可能出了什么问题吗?如何解决它?我使用的是react redux firebase 2.2.6。
index.js文件
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import * as serviceWorker from "./serviceWorker";
import { createStore, applyMiddleware, compose } from "redux";
import rootReducer from "./store/reducers/rootReducer";
import { Provider } from "react-redux";
import thunk from "redux-thunk";
import { reduxFirestore, getFirestore } from "redux-firestore";
import { reactReduxFirebase, getFirebase } from "react-redux-firebase";
import fbConfig from "./config/fbConfig";
const store = createStore(
rootReducer,
compose(
applyMiddleware(
thunk.withExtraArgument({
getFirebase,
getFirestore
})
),
reduxFirestore(fbConfig),
reactReduxFirebase(fbConfig)
)
);
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById("root")
);
serviceWorker.unregister();
fbConfig.js文件。出于安全原因,详细信息已被删除。我保证在尝试运行代码时会提供所有有效凭据。
import firebase from 'firebase/app';
import 'firebase/firestore';
import 'firebase/auth';
var fbConfig = {
apiKey: //API KEY HERE,
authDomain: //authDomain here,
databaseURL: ,
projectId: ,
storageBucket: ,
messagingSenderId: ,
appId: ,
measurementId:
};
firebase.initializeApp(fbConfig);
firebase.firestore().settings({ timestampsInSnapshots: true });
export default firebase;
此问题与最新版本的react redux firebase有关。为了解决这个问题,我安装了以前的版本。2.8.1版具体说明。它现在运行良好