weather_app_tutorial
weather_app_tutorial copied to clipboard
Uncaught TypeError: Cannot read property 'apply' of undefined at redux.js:523
Hey! I'm going through your Medium article. I cloned down the most recent version (which seems to have been refactored a bit since the article was written), added my API key, and started my server and client, but I'm getting the following error when it's trying to create the "store":
Any ideas? I'm fairly new to React, so I'm not sure what's going on here.
I made this go away by installing the Redux Devtools extension for Chrome. There is also an npm package redux-devtools I am going to try for a non-browser dependent solution.
It was successful. Try installing redux-dev-tools as a dev dependency in the client directory then replace client/src/store/index.js with:
import { createStore, applyMiddleware } from 'redux';
import createSagaMiddleware from 'redux-saga';
import rootReducer from './reducers/index';
import rootSaga from './sagas/index';
import { composeWithDevTools } from 'redux-devtools-extension';
const sagaMiddleware = createSagaMiddleware();
const store = createStore(
rootReducer,
composeWithDevTools(applyMiddleware(sagaMiddleware))
);
sagaMiddleware.run(rootSaga);
export default store;