title: Universal redux: browserhistory error: cannot read property 'listen' of undefined
body: <p>I'm trying to implement universal rendering for my react-redux app using express.js server, i'm following the tutorial on: <a href="http://redux.js.org/docs/recipes/ServerRendering.html" rel="nofollow">http://redux.js.org/docs/recipes/ServerRendering.html</a></p>
  
  <p>whenever i try to import the rootreducer or App files into the express server.js file as described in the tutorial i get the following error:</p>
  
  <pre><code>\node_modules\react-router-redux\lib\sync.js:105
   unsubscribeFromHistory = history.listen(handleLocationChange);
                                ^
  TypeError: Cannot read property 'listen' of undefined
  at syncHistoryWithStore (C:\Users\user pc\Desktop\citydrill\node_modules\react-router-redux\lib\sync.js:105:35)
  </code></pre>
  
  <p>This is my store file relevant code:</p>
  
  <pre><code>import { syncHistoryWithStore } from 'react-router-redux';
  import { browserHistory } from 'react-router';
  
  const store = createStore(rootReducer, initialState, compose(
      applyMiddleware(thunk)
  ));
  
  export const history = syncHistoryWithStore(browserHistory, store);
  </code></pre>
  
  <p>Then i just use the history const in the clientApp like this:</p>
  
  <pre><code>const router = (
  &lt;Provider store={store}&gt;
      &lt;Router history={history}&gt;
          &lt;Route name="Home" path="/" component={App}&gt;
              &lt;IndexRoute name="Home" component={Landing}&gt;&lt;/IndexRoute&gt;
          &lt;/Route&gt;
      &lt;/Router&gt;
  &lt;/Provider&gt;
  </code></pre>
  
  <p>)</p>
  
  <p>I tried so many different tutorials other than the one in redux.js.org too and i'm always stuck at this one point because i always must import some file from my client code inside my express server.js file and whenever i do that i always end up getting the same error.</p>
  
  <p>How can i implement universal redux? what am i doing wrong? i followed so many tutorials and none of them mentioned this error, how come its working for these guys but not in my app?</p>
  
  <p>Thanks for the help</p>