FredericHeem / redux-act-async

Reduce boilerplate for redux async actions and reducers
Apache License 2.0
125 stars 22 forks source link

src/createReducerAsync.js: Unexpected token : ES7 Spread-Operator-Error during npm install #19

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hey :)

If I install the library via npm "redux-act-async": "0.11.0" I first had to add "babel-cli": "^6.11.4" that it compiles. However now I get the following error: `

redux-act-async@0.11.0 postinstall C:\gitRepos\abc\WebApp\node_modules\redux-act-async npm run build redux-act-async@0.11.0 build C:\gitRepos\abc\WebApp\node_modules\redux-act-async babel src --out-dir lib SyntaxError: src/createReducerAsync.js: Unexpected token (11:12) src\createActionAsync.js -> lib\createActionAsync.js 9 | return createReducer({ 10 | [actionAsync.request]: (state, payload) => ({ 11 | ...state, | ^ 12 | request: payload, 13 | loading: true, 14 | error: null `

It seems that the ES7 Spread-operator can't be interpreted.

Is that just an error at my side or do you can reproduce that error?

FredericHeem commented 8 years ago

What is the content of .babelrc ?

ghost commented 8 years ago

Mhhh. You are right, I did all my ES6 stuff within webpack config file so far: {test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/, query: { presets: ['es2015', 'react', 'stage-0']}},

After I had added .babelrc to my root dir with the following content, npm install worked: { "presets": ["es2015", "react","stage-0"] }

Thanks for your help and your great framework :)