react-router-tutorial icon indicating copy to clipboard operation
react-router-tutorial copied to clipboard

[add] adds .babelrc file to fix webpack compiling error when running npm start

Open Sefton419 opened this issue 8 years ago • 3 comments

Without the .babelrc file, I am unable to successfully compile with npm start. Now it works. Hopefully this help others like me trying to learn react-router!

Sefton419 avatar Nov 07 '16 19:11 Sefton419

What error message are you getting? Maybe you didn't install all your dependencies? Lesson 1 should work and what you have added is done as part of this line https://github.com/reactjs/react-router-tutorial/blob/master/lessons/01-setting-up/webpack.config.js#L11

Andersos avatar Nov 07 '16 22:11 Andersos

I took away my .babelrc file again, and I still get the same error when I ran npm start initially (after running npm install for the getting started section).

This is the error message I get, which is fixed by adding .babelrc file.

error

I'm not sure why the webpack babel-loader preset isn't working.

Sefton419 avatar Nov 07 '16 23:11 Sefton419

Can you try again with the following steps:

git clone https://github.com/reactjs/react-router-tutorial
cd react-router-tutorial
cd lessons/01-setting-up
npm install
npm start

Andersos avatar Nov 08 '16 08:11 Andersos