I've been working on a project using react-redux-firebase, which has worked for me before. today I got the following error:
I'm not sure if the error is somewhere else in my code or if I have to update react-redux-firebase to version 3.., which doesn't seem to exist as of now. Has anyone else had this issue? I'd be grateful for any suggestions.
Here are the dependencies in my package.json:
"dependencies": {
"firebase": "^5.7.0",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react-redux": "^6.0.0",
"react-redux-firebase": "^2.2.5",
"react-router-dom": "^4.3.1",
"react-scripts": "2.1.1",
"redux": "^4.0.1",
"redux-firestore": "^0.6.0",
"redux-thunk": "^2.3.0"
},
This is what my index.js file looks like:
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/index';
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 './firebase/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();
Editor's Note: This article was updated on 20 November 2021 to include information on Redux Toolkit. Firebase is a popular BaaS (backend-as-a-service), which allows web and mobile developers to implement common backend tasks like user authentication, storage, and creating databases.
You can check successful installation by opening the command prompt and type node -v. This will show you the latest version of Node in your system. To check if npm is installed successfully, you can type npm –v which returns you the latest npm version.
1- Download v3 as following:
npm i --save react-redux-firebase@latest
Then you can refactor your code to work with v3 as written here in the docs: https://github.com/prescottprue/react-redux-firebase/tree/next
2- Or just use react-redux v5.1.1
npm i --save react-redux@^5.0.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With