title: react-router-redux: Module build failed: SyntaxError: Unexpected token ...reducers
body: <p><a href="https://i.stack.imgur.com/BAUgb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BAUgb.png" alt="I&#39;m facing this error while trying to integrate react-router-redux into my React project. Following is my app.js code and reducers/index.js"></a></p>
  
  <pre><code>//app.js
  import React from 'react';
  import ReactDOM from 'react-dom';
  import { Provider } from 'react-redux';
  import { createStore, combineReducers, applyMiddleware } from 'redux';
  import createHistory from 'history/createBrowserHistory';
  import { Route } from 'react-router';
  
  import { ConnectedRouter, routerReducer, routerMiddleware, push } from 'react-router-redux';
  
  import App from './components/app.js';
  import reducers from './reducers';
  
  const history = createHistory();
  const middleware = routerMiddleware(history);
  
  // Add the reducer to your store on the `router` key
  // Also apply our middleware for navigating
  const store = createStore({
      ...reducers,
      router: routerReducer
    },
    applyMiddleware(middleware)
  );
  
  const About = () =&gt; {
    return (&lt;div&gt;
      Will this work?
    &lt;/div&gt;);
  }
  
  ReactDOM.render(
    &lt;Provider store={store}&gt;
      &lt;ConnectedRouter history={history}&gt;
        &lt;div&gt;
          &lt;Route exact path="/" component={App}/&gt;
          &lt;Route path="/about" component={About}/&gt;
        &lt;/div&gt;
      &lt;/ConnectedRouter&gt;
    &lt;/Provider&gt;
    , document.querySelector('#app'));
  </code></pre>
  
  <p>Here is my reducers/index.js code. </p>
  
  <pre><code>//reducers/index.js
  import { combineReducers } from 'redux';
  import { mobileLinks } from './reducer_header';
  import UserDetailsReducer from './reducer_user_details';
  
  const rootReducer = combineReducers({
    mobileLinks,
    userDetails: UserDetailsReducer
  });
  
  export default rootReducer;
  </code></pre>
  
  <p>What do I do to fix this? I'm unable to find any examples for the new version of react-router-redux. I've tried moving the routerReducer to reducers/index.js but that didn't work either. Can someone please help?</p>