1

I have made a web app that has a few components and displays some texts depending on which button is pressed. However when i do npm run build it makes the build folder and everything in it but once i click on the index.html file it opens a blank page, same happens when i try to open it through a link on github. If anyone can help me figure this out i would be very thankful.


-my web app picture

-successful build

-files in the build folder

CREM
  • 1,929
  • 1
  • 25
  • 35
  • Run it on a web server. See the build informations. Run: npm install -g serve serve -s build – PRogalla Dec 19 '18 at 15:58
  • 1
    Are you using create-react-app ? – CREM Dec 19 '18 at 16:05
  • 1337 - i tried this but it didnt change anything PS C:\Users\Nikola\Desktop\myBook\my_book_app> npm install -g serve serve -s build C:\Users\Nikola\AppData\Roaming\npm\serve -> C:\Users\Nikola\AppData\Roaming\npm\node_modules\serve\bin\serve.js + serve@10.1.1 + serve@10.1.1 + build@0.1.4 ******** Crying Freeman - yes, i am – Nikola Veselinovic Dec 19 '18 at 16:18
  • i followed all suggestions made in this thread but none of them worked => https://stackoverflow.com/questions/39791069/create-react-app-npm-run-build-command?rq=1 – Nikola Veselinovic Dec 19 '18 at 16:26
  • Is it your site served ok, if you make serve -s build ? Locally – CREM Dec 19 '18 at 16:39
  • this is what i get when i type run serve -s build: Serving! Local: http://localhost:5000 On Your Network: http://X:5000 – Nikola Veselinovic Dec 19 '18 at 18:45
  • If it serves the app ok locally, then your problem is in the server(IIS or Apache or whatever) where your compiled app runs, the compiled SPAs created by create-react-app or angular-cli will run on any http server. If you do complex things with the react router then take a look at that – CREM Dec 19 '18 at 19:47
  • @Nicola have you tried to open your serving app with localhost:5000 in your browser? – PRogalla Dec 20 '18 at 13:54

0 Answers0