title: redux-promise: Uncaught TypeError: middleware is not a function
body: <p>I am building a webpage with react. I used a tutorial from udemy where the author used redux promise for rest calls. It worked in the course.</p>
  
  <p>In my own project, I set up everything the same and when I try to create the store with the redux-promise middleware, I get the following error when launching the website:</p>
  
  <pre><code>Uncaught TypeError: middleware is not a function
  at http://localhost:3000/index.js:34412:16
  at Array.map (native)
  at http://localhost:3000/index.js:34411:27
  at Object.&lt;anonymous&gt; (http://localhost:3000/index.js:15744:70)
  at Object.&lt;anonymous&gt; (http://localhost:3000/index.js:15748:27)
  at Object.options.path (http://localhost:3000/index.js:15749:30)
  at __webpack_require__ (http://localhost:3000/index.js:658:30)
  at fn (http://localhost:3000/index.js:86:20)
  at Object.&lt;anonymous&gt; (http://localhost:3000/index.js:35118:18)
  at __webpack_require__ (http://localhost:3000/index.js:658:30)
  </code></pre>
  
  <p>The error comes up here (according to the console):</p>
  
  <pre><code>applyMiddleware.js:39
  </code></pre>
  
  <p>If I use another middleware, like redux-thunk, it works (well, except my rest calls but that is another story). Any suggestions why this error happens?</p>
  
  <p>Versions I am running:</p>
  
  <pre><code>"axios": "^0.15.3",
  "es6-promise": "^4.0.5",
  "react": "^15.4.2",
  "react-dom": "^15.4.2",
  "react-redux": "^5.0.4",
  "react-router": "^3.0.2",
  "redux": "^3.6.0",
  "redux-promise": "^0.5.3"
  </code></pre>
  
  <p>My index.tsx:</p>
  
  <pre><code>import * as React from 'react';
  import * as ReactDOM from 'react-dom';
  import { Provider } from 'react-redux';
  import { createStore, applyMiddleware } from 'redux';
  import {Router, Route, browserHistory, IndexRoute} from 'react-router';
  import thunk from 'redux-thunk';
  import reduxPromise from 'redux-promise';
  
  import reducers from './app/reducers';
  import routes from './routes';
  
  import './index.scss';
  
  const createStoreWithMiddleware = applyMiddleware(reduxPromise)(createStore);
  
  ReactDOM.render(
    &lt;Provider store={createStoreWithMiddleware(reducers)}&gt;
      &lt;Router history={browserHistory} routes={routes} /&gt;
    &lt;/Provider&gt;
    ,document.getElementById('root')
  );
  </code></pre>
  
  <p>Dou you need more informations (like the reducers, actions, etc.)? </p>
  
  <p>The error comes up, when this line is called:</p>
  
  <pre><code>&lt;Provider store={createStoreWithMiddleware(reducers)}&gt;
  </code></pre>