bananaoomarang / isomorphic-redux

Isomorphic Redux demo, with routing and async actions
https://medium.com/@bananaoomarang/handcrafting-an-isomorphic-redux-application-with-love-40ada4468af4
MIT License
455 stars 87 forks source link

ReferenceError: Promise is not defined #47

Closed jjmoorhouse closed 8 years ago

jjmoorhouse commented 8 years ago

Hi,

Running ubuntu 14.04, node version v0.10.25

Go to http://localhost:3000/ and see the following error:

ReferenceError: Promise is not defined
   at Axios.request (/home/james/project/isomorphic-redux/node_modules/axios/lib/axios.js:45:17)
   at Axios.(anonymous function) [as get] (/home/james/project/isomorphic-redux/node_modules/axios/lib/axios.js:86:17)
   at Function.wrap [as get] (/home/james/project/isomorphic-redux/node_modules/axios/lib/helpers/bind.js:9:15)
   at getTodos (TodoActions.js:8:22)
   at fetchComponentData.js:7:47
   at Array.map (native)
   at fetchComponentData (fetchComponentData.js:7:26)
   at server.jsx:70:5
   at /home/james/project/isomorphic-redux/node_modules/react-router/lib/match.js:58:5
   at /home/james/project/isomorphic-redux/node_modules/react-router/lib/useRoutes.js:120:15
bananaoomarang commented 8 years ago

This is because older versions of node (<11 I think) don't have native Promises.

Have just added babel-polyfill so it should work now :)

If you have these sorts of problems often I would recommend a node package manager like nvm, for instance. Sometimes it is useful to have multiple versions installed.

jjmoorhouse commented 8 years ago

Thanks!