title: Cannot read property 'type' of undefined (react-router-redux)
body: <p>I am trying to redirect to the page after signing out. However, every time when I sign out, it directs the page successfully. However, I still got the error</p>
  
  <blockquote>
    <p>Cannot read property 'type' of undefined</p>
  </blockquote>
  
  <p>Further research by "Pause on Caught Exceptions", it is related with <strong>react-router-redux</strong>.</p>
  
  <p><a href="https://i.stack.imgur.com/58CoF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/58CoF.png" alt="enter image description here"></a></p>
  
  <p>So the line <code>store.dispatch(push('/signin'))</code> in the code below causes the issue. If I change to <code>.map(() =&gt; ({ type: 'NOT_EXIST' }));</code>, there will be no issue.</p>
  
  <p>What may cause this? Thanks</p>
  
  <p><strong>actions/auth.action.js</strong></p>
  
  <pre><code>export const signOutSucceedEpic = (action$, store) =&gt;
    action$
      .ofType(SIGN_OUT_SUCCEED)
      .map(() =&gt; store.dispatch(push('/signin')));  // &lt;- this line causes the issue
  </code></pre>
  
  <p><strong>actions/index.js</strong></p>
  
  <pre><code>import { combineEpics } from 'redux-observable';
  
  export default combineEpics(
    // ...
    signOutSucceedEpic
  );
  </code></pre>
  
  <p><strong>index.js</strong></p>
  
  <pre><code>import { Provider } from 'react-redux';
  import { Route } from 'react-router-dom';
  import { ConnectedRouter, routerMiddleware, push } from 'react-router-redux';
  import createHistory from 'history/createBrowserHistory';
  import rootEpic from './actions/index';
  
  const history = createHistory();
  const routeMiddleware = routerMiddleware(history);
  const epicMiddleware = createEpicMiddleware(rootEpic);
  
  export const store = createStore(
    rootReducer,
    persistedState,
    composeWithDevTools(
      applyMiddleware(
        epicMiddleware,
        routeMiddleware
      )
    )
  );
  
  ReactDOM.render(
    &lt;Provider store={store}&gt;
      &lt;ConnectedRouter history={history}&gt;
        &lt;div&gt;
          &lt;Route path="/signin" component={SignIn} /&gt;
          &lt;Route exact path="/" component={Home} /&gt;
        &lt;/div&gt;
      &lt;/ConnectedRouter&gt;
    &lt;/Provider&gt;,
    document.getElementById('root')
  );
  </code></pre>