{"action":"created","issue":{"url":"https://api.github.com/repos/bvaughn/redux-search/issues/60","repository_url":"https://api.github.com/repos/bvaughn/redux-search","labels_url":"https://api.github.com/repos/bvaughn/redux-search/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/bvaughn/redux-search/issues/60/comments","events_url":"https://api.github.com/repos/bvaughn/redux-search/issues/60/events","html_url":"https://github.com/bvaughn/redux-search/issues/60","id":207459050,"number":60,"title":"Uncaught TypeError: Cannot read property 'get' of undefined","user":{"login":"StlthyLee","id":36741,"avatar_url":"https://avatars.githubusercontent.com/u/36741?v=3","gravatar_id":"","url":"https://api.github.com/users/StlthyLee","html_url":"https://github.com/StlthyLee","followers_url":"https://api.github.com/users/StlthyLee/followers","following_url":"https://api.github.com/users/StlthyLee/following{/other_user}","gists_url":"https://api.github.com/users/StlthyLee/gists{/gist_id}","starred_url":"https://api.github.com/users/StlthyLee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StlthyLee/subscriptions","organizations_url":"https://api.github.com/users/StlthyLee/orgs","repos_url":"https://api.github.com/users/StlthyLee/repos","events_url":"https://api.github.com/users/StlthyLee/events{/privacy}","received_events_url":"https://api.github.com/users/StlthyLee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-14T09:21:07Z","updated_at":"2017-02-14T10:46:17Z","closed_at":null,"body":"I seem to be having trouble setting up redux-search in my project. Even though I've set it up in exactly the same way as displayed here [https://github.com/bvaughn/redux-search/blob/master/website/createAppStore.js](https://github.com/bvaughn/redux-search/blob/master/website/createAppStore.js) and using the information provided on the README, when I open my app in the browser to check that nothing is broken I am getting the following error: \r\n\r\n`Uncaught TypeError: Cannot read property 'get' of undefined`\r\n\r\nThe error is coming form this line: \r\n\r\n`return state.resources.get(resourceName);`\r\n\r\nany ideas what could be causing this?\r\n\r\nHere is the my createStore code: \r\n\r\n```\r\nimport { createStore as _createStore, applyMiddleware, compose } from 'redux';\r\nimport { reduxSearch } from 'redux-search';\r\nimport createMiddleware from './middleware/clientMiddleware';\r\nimport rootReducer from '../reducers/rootReducer';\r\n\r\nexport default function createStore(history, client, data) {\r\n  // Sync dispatched route actions to the history\r\n  const middleware = [createMiddleware(client)];\r\n  let finalCreateStore;\r\n  if (__DEVELOPMENT__ && __CLIENT__ && __DEVTOOLS__) {\r\n    finalCreateStore = compose(\r\n      applyMiddleware(...middleware),\r\n      reduxSearch({\r\n        resourceIndexes: {\r\n          users: ['name'],\r\n        },\r\n        resourceSelector: (resourceName, state) => {\r\n          return state.resources.get(resourceName);\r\n        },\r\n      }),\r\n      // The code below is needed to make chrome Redux dev tools work.\r\n      // window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()\r\n    )(_createStore);\r\n  } else {\r\n    finalCreateStore = applyMiddleware(...middleware)(_createStore);\r\n  }\r\n  const store = finalCreateStore(rootReducer, data);\r\n\r\n  if (__DEVELOPMENT__ && module.hot) {\r\n    module.hot.accept(rootReducer, () => {\r\n      store.replaceReducer(rootReducer);\r\n    });\r\n  }\r\n  return store;\r\n}\r\n```\r\n![screen shot 2017-02-14 at 09 20 26](https://cloud.githubusercontent.com/assets/36741/22922748/e3df4e68-f296-11e6-8501-b032bfbd8083.png)\r\n\r\nAny help would be appreciated.\r\n\r\nThanks in advance"},"comment":{"url":"https://api.github.com/repos/bvaughn/redux-search/issues/comments/279673566","html_url":"https://github.com/bvaughn/redux-search/issues/60#issuecomment-279673566","issue_url":"https://api.github.com/repos/bvaughn/redux-search/issues/60","id":279673566,"user":{"login":"StlthyLee","id":36741,"avatar_url":"https://avatars.githubusercontent.com/u/36741?v=3","gravatar_id":"","url":"https://api.github.com/users/StlthyLee","html_url":"https://github.com/StlthyLee","followers_url":"https://api.github.com/users/StlthyLee/followers","following_url":"https://api.github.com/users/StlthyLee/following{/other_user}","gists_url":"https://api.github.com/users/StlthyLee/gists{/gist_id}","starred_url":"https://api.github.com/users/StlthyLee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StlthyLee/subscriptions","organizations_url":"https://api.github.com/users/StlthyLee/orgs","repos_url":"https://api.github.com/users/StlthyLee/repos","events_url":"https://api.github.com/users/StlthyLee/events{/privacy}","received_events_url":"https://api.github.com/users/StlthyLee/received_events","type":"User","site_admin":false},"created_at":"2017-02-14T10:46:17Z","updated_at":"2017-02-14T10:46:17Z","body":"After doing a bit more digging (not a huge amount admittedly) it would appear that the resources map is not being added to the state. "}}
{"actor":{"display_login":"StlthyLee"}}