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

Won't start: Use of const in strict mode. #3

Closed edwardmsmith closed 9 years ago

edwardmsmith commented 9 years ago

I'm new to the whole es6/babel thing, but interested in trying this out.

I've cloned the repo and when I try to start it with either npm start or npm run dev, I get the following error:

const PORT = process.env.PORT || 3000;
^^^^^
SyntaxError: Use of const in strict mode.

Obviously it goes away if I remove the use strict or change const to var, but have to assume I'm doing something wrong elsewhere.

I'm using node v0.12.7 (through nvm). Are you actually running this on IO.js?

Thanks!

bananaoomarang commented 9 years ago

Hi!

I wrote the tutorial using IO.js, which I probably should have mentioned. Node still requires that you pass --harmony to enable base ES6 const/let etc. support. You can also turn on other features with other flags, but only index.js is untouched by Babel here, so you shouldn't need to.

I just pushed a new package.json which should fix this (seems to work locally in 0.12.6). Let me know :)

edwardmsmith commented 9 years ago

Thank you!

I considered adding the --harmony flag, but did not know if that would interfere with the babel stuff.

bananaoomarang commented 9 years ago

Ah, no problem. I don't think it should interfere with the babel, fingers crossed!