btholt / complete-intro-to-react

A Complete Intro to React, as Given for Frontend Masters
https://frontendmasters.com/learn/react/
MIT License
1.06k stars 927 forks source link

Errors on Windows #74

Open alexwebbb opened 7 years ago

alexwebbb commented 7 years ago

I get a like 3000+ errors when ESlint runs, lint -- --fix reduces it to like 84 errors

Running Windows 10, my other react apps work just fine.

A small portion of the result of running webpack afterwards

 @ ./js/Search.jsx 16:16-37
 @ ./js/App.jsx
 @ ./js/ClientApp.jsx
 @ multi ./js/ClientApp.jsx ./js/ClientApp.js ./public/bundle.js

ERROR in ./js/Header.jsx

C:\Users\alexw\Source\complete-intro-to-react\js\Header.jsx
  8:22  error  Parsing error: Unexpected token :

✖ 1 problem (1 error, 0 warnings)

 @ ./js/Search.jsx 20:14-33
 @ ./js/App.jsx
 @ ./js/ClientApp.jsx
 @ multi ./js/ClientApp.jsx ./js/ClientApp.js ./public/bundle.js

ERROR in ./js/reducers.js

C:\Users\alexw\Source\complete-intro-to-react\js\reducers.js
  6:39  error  Parsing error: Unexpected token :

✖ 1 problem (1 error, 0 warnings)

 @ ./js/store.js 17:16-37
 @ ./js/App.jsx
 @ ./js/ClientApp.jsx
 @ multi ./js/ClientApp.jsx ./js/ClientApp.js ./public/bundle.js

C:\Users\alexw\Source\complete-intro-to-react>
gpspake commented 7 years ago

When you see those unexpected token errors, it's often because babel isn't loading the correct plugins or they're being loaded in the correct order. It seems to me that, for some reason the "env" preset that loads the es2015 plugin isn't ever being loaded on Windows. I still haven't been able to figure out how it's working elsewhere.

alexwebbb commented 7 years ago

I ended up continuing this course by running it in a create-react-app project. Everything works if you just keep everything in the source folder and be sure to export an App component as the root component at some point

alexwebbb commented 7 years ago

extremely puzzled to find "//" comments in the css file