ReactJS - net::ERR_FILE_NOT_FOUND ReactJS - net::ERR_FILE_NOT_FOUND reactjs reactjs

ReactJS - net::ERR_FILE_NOT_FOUND


  1. Open your package.json file.
  2. Add this entry to it "homepage":"path\to\your\project\build\"
  3. Re-run the command npm run build.

The issue here was when you run the npm run build command without the homepage entry added in your package.json,it is built assuming that the project directory (where you are running the command) is hosted at server root.

screen-shot commandline

D:\git_repo\my-app>npm run build> my-app@0.1.0 build D:\git_repo\my-app> react-scripts buildCreating an optimized production build...Compiled successfully.File sizes after gzip:  44.57 KB  build\static\js\main.8a29685f.js**The project was built assuming it is hosted at root directory.You can control this with the homepage field in your package.json.**The build folder is ready to be deployed.D:\git_repo\my-app>


How are you running your app? Are you just opening the index.html in the browser or are you using serve -s build and such?

If you are doing it by the first option then you should consider trying serve -s build