flexdinesh / react-redux-boilerplate

A minimal React-Redux boilerplate with all the best practices
MIT License
782 stars 274 forks source link

ℹ 「wdm」: Failed to compile from fresh clone #24

Closed nicolabortignon closed 5 years ago

nicolabortignon commented 6 years ago

On Osx 10.14. Node v8.12.0 NPM 6.4.1.

Just out of fresh clone:


Server started ! ✓

Access URLs:
-----------------------------------
Localhost: http://localhost:3000
      LAN: http://172.22.175.36:3000
-----------------------------------
Press CTRL-C to stop

webpack built b98cb75864bb6ea5e219 in 804ms
✖ 「wdm」:
ERROR in ./app/app.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: Unexpected token (52:4)

  50 | const render = () => {
  51 |   ReactDOM.render(
> 52 |     <Provider store={store}>
     |     ^
  53 |       {/* <LanguageProvider messages={messages}> */}
  54 |       <ConnectedRouter history={history}>
  55 |         <App />
manishbalyan commented 6 years ago

add .babelrc file in root directory of the project with below configuration

{ "presets": [ [ "env", { "modules": false } ], "react", "stage-0" ], "env": { "production": { "only": ["app"], "plugins": [ "transform-react-remove-prop-types", "transform-react-constant-elements", "transform-react-inline-elements" ] }, "test": { "plugins": ["transform-es2015-modules-commonjs", "dynamic-import-node"] } } }

flexdinesh commented 5 years ago

@nicolabortignon Have you resolved the issue now?

nicolabortignon commented 5 years ago

@manishbalyan's solution solves the issue. Will PR the Readme to add the info.