iamshaunjp / React-Redux-Firebase-App

All course files for the React, Redux & Firebase App playlist on The Net Ninja YouTube channel.
551 stars 477 forks source link

error in composing firebasestore and firebase with middelware. #30

Open pralhad88 opened 4 years ago

pralhad88 commented 4 years ago

const store = createStore(rootReducer, compose( applyMiddleware(thunk.withExtraArgument({getFirebase, getFirestore})), reactReduxFirebase(fbConfig), // redux binding for firebase reduxFirestore(fbConfig) // redux bindings for firestore ) );

in this line error is throwing it says TypeError: Object(...) is not a function and say __webpack_require__ in webpack/bootstrap:785 line

pralhad88 commented 4 years ago

please give me some solution so I can move forward to watch next tutorial thank you.

avirupdutta commented 4 years ago

i also faced the same problem... The problem lies in this line:-

reactReduxFirebase(fbConfig), // redux binding for firebase

looks like they've made a breaking change. Remove that line and everything should work out fine.

Final snippet you should have:- const store = createStore(rootReducer, compose( applyMiddleware(thunk.withExtraArgument({getFirebase, getFirestore})), reduxFirestore(fbConfig) // redux bindings for firestore ) );

For detailed explanation check these out:- https://stackoverflow.com/questions/55559816/typeerror-object-is-not-a-function-on-index-js http://docs.react-redux-firebase.com/history/v3.0.0/docs/v3-migration-guide.html

AhmedMalekX commented 4 years ago

@pralhad88 to solve this problem update "react-redux-firebase" property on your package.json file with this version "2.1.6" and the problem will solved.

SaadEla commented 4 years ago

@pralhad88 it's a react-redux-firebase version problem in the tuto we are working with version 2 and there is some update's fro v2 to v3. For me i installed the version 2 and completed the tuto

u can do it by executing in the terminal : npm i --save react-redux-firebase^@2.5.0