Open psilva261 opened 7 years ago
When starting out with a fresh boilerplate, npm i fails at the end, same for npm start / npm build:
npm i
npm start
npm build
Hash: 09ec8ce1ed1d0b965d0c Version: webpack 1.14.0 Time: 2175ms [0] multi main 40 bytes {0} [built] [1 error] + 12 hidden modules ERROR in ./app/main.js Module build failed: SyntaxError: Unexpected token (12:2) 10 | 11 | ReactDOM.render( > 12 | <Provider store={store}> | ^ 13 | <Router history={browserHistory} routes={getRoutes(store)}/> 14 | </Provider>, 15 | document.getElementById('app') BabelLoaderError: SyntaxError: Unexpected token (12:2) 10 | 11 | ReactDOM.render( > 12 | <Provider store={store}> | ^ 13 | <Router history={browserHistory} routes={getRoutes(store)}/> 14 | </Provider>, 15 | document.getElementById('app') at transpile (/Users/p/Code/HackOut/node_modules/babel-loader/lib/index.js:52:13) at Object.module.exports (/Users/p/Code/HackOut/node_modules/babel-loader/lib/index.js:133:12)
The fix is simple, on needs to configure babel through a .babelrc:
.babelrc
{ "presets": ["es2015", "react"] }
Please add this to the main readme! I struggled for two days for this :(
When starting out with a fresh boilerplate,
npm i
fails at the end, same fornpm start
/npm build
:The fix is simple, on needs to configure babel through a
.babelrc
: