rafgraph / spa-github-pages

Host single page apps with GitHub Pages
https://spa-github-pages.rafgraph.dev
MIT License
3.83k stars 565 forks source link

Syntax error for BrowserRouter #20

Closed ambershen closed 7 years ago

ambershen commented 7 years ago

when I try to run npm run build, it always return me a compiling error: image

don't know how to solve this

rafgraph commented 7 years ago

This is mostly likely because React in not in scope or Babel is not setup properly.

I just tried cloning the repo and running npm install and then npm run build and it worked fine. Do you still have this problem with a fresh clone, install and build without changing any of the files?

dgurns commented 6 years ago

I'm getting the same error, even after updating Node and NPM to latest versions. npm run build fails with the following error message:

screen shot 2018-03-30 at 11 24 36 am

UPDATE: This was happening because the .babelrc did not clone initially. I had to manually add it to my local repo. Now everything works.