weather_app_tutorial icon indicating copy to clipboard operation
weather_app_tutorial copied to clipboard

Uncaught TypeError: Cannot read property 'apply' of undefined at redux.js:523

Open wesleymusgrove opened this issue 6 years ago • 2 comments

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":

image

Any ideas? I'm fairly new to React, so I'm not sure what's going on here.

wesleymusgrove avatar Oct 01 '18 04:10 wesleymusgrove

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.

koopcodes avatar Oct 24 '18 23:10 koopcodes

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;

koopcodes avatar Oct 26 '18 23:10 koopcodes