Quinlan Hill
Quinlan Hill

Reputation: 141

react-redux v6 a v3.*.* version of react-redux-firebase is required

I've been working on a project using react-redux-firebase, which has worked for me before. today I got the following error:

chrome error message

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();

Upvotes: 14

Views: 7822

Answers (6)

Theo
Theo

Reputation: 81

Just downgrade to [email protected] and [email protected] to fix this error. Using framework and boilerplate code in your app is a blessing and a curse at the same time.

Run these commands ....

npm -i [email protected]
npm -i [email protected]

Or these

npm i --save [email protected]
npm i --save [email protected]

Upvotes: 8

GPRatcliffe
GPRatcliffe

Reputation: 26

After struggling quite a bit with learning this (in part due to an outdated course on Udemy) I found that npm i --s react-redux-firebase@latest was downloading 2.4.0.

npm i --s react-redux-firebase@next

The above did the trick and returned [email protected]

Upvotes: 1

Johnson Ogwuru
Johnson Ogwuru

Reputation: 35

Running yarn add react-redux-firebase@next, and going through the documentation of firebase version3 helped me fix the issue. Here is the documentation

Upvotes: 1

Nuwan Dissanayaka
Nuwan Dissanayaka

Reputation: 181

Use this : npm install [email protected]

Upvotes: 1

rerich
rerich

Reputation: 277

You can install v3 with npm i --save react-redux-firebase@next for now.

from http://docs.react-redux-firebase.com/history/v3.0.0/

Interested in support for react-redux@^6 or the new react context API? Checkout the next branch which contains the next upcoming major version (installed through npm i --save react-redux-firebase@next).

Upvotes: 2

shyma sane
shyma sane

Reputation: 180

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

Upvotes: 18

Related Questions