{"action":"closed","issue":{"url":"https://api.github.com/repos/reactjs/redux/issues/2715","repository_url":"https://api.github.com/repos/reactjs/redux","labels_url":"https://api.github.com/repos/reactjs/redux/issues/2715/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/redux/issues/2715/comments","events_url":"https://api.github.com/repos/reactjs/redux/issues/2715/events","html_url":"https://github.com/reactjs/redux/issues/2715","id":274631643,"number":2715,"title":"[4.0] Uncaught TypeError: Cannot read property 'state' of undefined","user":{"login":"amackintosh","id":25964567,"avatar_url":"https://avatars1.githubusercontent.com/u/25964567?v=4","gravatar_id":"","url":"https://api.github.com/users/amackintosh","html_url":"https://github.com/amackintosh","followers_url":"https://api.github.com/users/amackintosh/followers","following_url":"https://api.github.com/users/amackintosh/following{/other_user}","gists_url":"https://api.github.com/users/amackintosh/gists{/gist_id}","starred_url":"https://api.github.com/users/amackintosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amackintosh/subscriptions","organizations_url":"https://api.github.com/users/amackintosh/orgs","repos_url":"https://api.github.com/users/amackintosh/repos","events_url":"https://api.github.com/users/amackintosh/events{/privacy}","received_events_url":"https://api.github.com/users/amackintosh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/reactjs/redux/milestones/3","html_url":"https://github.com/reactjs/redux/milestone/3","labels_url":"https://api.github.com/repos/reactjs/redux/milestones/3/labels","id":1681623,"number":3,"title":"4.0","description":"","creator":{"login":"gaearon","id":810438,"avatar_url":"https://avatars0.githubusercontent.com/u/810438?v=4","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":11,"state":"open","created_at":"2016-04-04T11:24:11Z","updated_at":"2017-11-17T01:53:06Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2017-11-16T19:15:52Z","updated_at":"2017-11-17T01:53:06Z","closed_at":"2017-11-17T01:53:06Z","author_association":"NONE","body":"**Do you want to request a *feature* or report a *bug*?**  \r\nPossible bug\r\n\r\n**What is the current behavior?**\r\nDetonation after install Redux 4.0\r\n\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar.**\r\n1. Install Redux 4.0\r\n2. Run app\r\n\r\n\r\n**What is the expected behavior?**\r\nShould work as normal :)\r\n\r\n\r\n**Which versions of Redux, and which browser and OS are affected by this issue? Did this work in previous versions of Redux?**\r\nWindows 10, Chrome newest\r\n```\r\n    \"react\": \"^16.0.0\",\r\n    \"react-apollo\": \"^1.4.16\",\r\n    \"react-dom\": \"^16.0.0\",\r\n    \"react-redux\": \"^5.0.6\",\r\n    \"react-router-dom\": \"^4.2.2\",\r\n    \"react-router-redux\": \"^5.0.0-alpha.8\",\r\n    \"redux\": \"^4.0.0-beta.1\",\r\n    \"redux-thunk\": \"^2.2.0\",\r\n```\r\nIt works correct with Redux 3.7.?\r\n\r\nHere is the error:\r\n![redux4](https://user-images.githubusercontent.com/25964567/32910521-575561fc-cabe-11e7-9d8b-77060fb6ba9b.png)\r\n\r\n`./src/root.jsx`\r\n``` javascript\r\nimport React from 'react'\r\nimport ReactDOM from 'react-dom'\r\nimport { ApolloClient, createNetworkInterface, ApolloProvider } from 'react-apollo'\r\nimport { withRouter, Route } from 'react-router-dom'\r\nimport { ConnectedRouter } from 'react-router-redux'\r\nimport browserHistory from './store/history'\r\nimport AuthGateway from './components/auth/AuthGateway'\r\nimport { AUTH_SUCCESS } from './components/auth/auth_types'\r\nimport App from './components/App'\r\nimport configure from './store'\r\nimport '../styles/app.scss'\r\n\r\nconst store = configure()\r\n\r\nconst tokenOnLoad = localStorage.getItem('token')\r\nif (tokenOnLoad) store.dispatch({ type: AUTH_SUCCESS })\r\n\r\nconst networkInterface = createNetworkInterface({\r\n  uri: 'http://localhost:8000/graphql',\r\n  opts: { credentials: 'same-origin', mode: 'cors' },\r\n})\r\nnetworkInterface.use([{\r\n  applyMiddleware(req, next) {\r\n    if (!req.options.headers) req.options.headers = {}\r\n    const token = localStorage.getItem('token')\r\n    req.options.headers.authorization = token || null\r\n    next()\r\n  },\r\n}])\r\n\r\nconst client = new ApolloClient({\r\n  networkInterface,\r\n  dataIdFromObject: o => o.id,\r\n})\r\n\r\nconst Root = () => (\r\n  <ApolloProvider store={store} client={client}>  // this is line 37 (in the above screenshot)\r\n    <AuthGateway>\r\n      <ConnectedRouter history={browserHistory}>\r\n        <Route path=\"/\" component={withRouter(App)} />\r\n      </ConnectedRouter>\r\n    </AuthGateway>\r\n  </ApolloProvider>\r\n)\r\nReactDOM.render(\r\n  <Root />,\r\n  document.querySelector('#root'),\r\n)\r\n\r\nexport default client\r\n```\r\n\r\n**./src/store/index.js**\r\n``` javascript\r\nimport { createStore, applyMiddleware } from 'redux'\r\nimport { routerMiddleware } from 'react-router-redux'\r\nimport reduxThunk from 'redux-thunk'\r\nimport tokenValidator from '../middleware/tokenvalidator'\r\nimport logger from '../middleware/logger'\r\nimport browserHistory from './history'\r\nimport rootReducer from '../reducers'\r\n\r\nconst historyMiddleware = routerMiddleware(browserHistory)\r\n\r\nexport default function configure(initialState) {\r\n  const create = window.devToolsExtension\r\n    ? window.devToolsExtension()(createStore)\r\n    : createStore\r\n\r\n  const createStoreWithMiddleware = applyMiddleware(\r\n    reduxThunk,\r\n    logger,\r\n    tokenValidator,\r\n    historyMiddleware,\r\n  )(create)\r\n\r\n  const store = createStoreWithMiddleware(rootReducer, initialState)\r\n  return store\r\n}\r\n```\r\n\r\n**./src/store/history.js**\r\n``` javascript\r\nimport createHistory from 'history/createBrowserHistory'\r\n\r\nexport default createHistory()\r\n```\r\n\r\nI do not know what to make of this currently, but I do notice that it's related to the `store` and inside the store index file, it is calling `import { createStore, applyMiddleware } from 'redux'`.\r\n\r\nI notice there were some changes to `applyMiddleware`, so something in my setup may point to a change there."}}
{"actor":{"display_login":"timdorr"}}