0

I try to test the build of my react application. On dev environnement, I do yarn start and all works fine on http://localhost:3000/

I want to deploy the build on my apache server:

http://www.myserver.com/myreactapp

Then I have update my package.json file to specify 'homepage' target by adding the line :

"homepage": "http://www.myserver.com/myreactapp",

Then I run : yarn build all and everything is ok.

I upload my files on my server and test the website. I have no error on console log, CSS and JS are loaded, the background image (define on my CSS) appears. But nothing else happens. It seems something is wrong with Router but how to debug and/or fix it ?

Thanks,

Orb

Orboo
  • 73
  • 10
  • 1
    FYI the `homepage` in `package.json` is meant to be used for libraries. For example if you were to distribute your project as an npm package this is the link that would be displayed on the npmjs.com website along with other info about your project. To your question: you probably have routes configured starting at `/`, and now the paths start with `/myreactapp/` which is not recognized by your router. – pawel Oct 19 '17 at 10:42
  • Maybe this will help: https://stackoverflow.com/questions/38196448/can-i-set-a-base-route-in-react-router – pawel Oct 19 '17 at 10:44

0 Answers0