Search code examples
javascriptreactjscreate-react-app

ReactJS - net::ERR_FILE_NOT_FOUND


I'm suddenly having issues with production versions of my react apps. They work fine in development, however when I build them, I get a console error:

/static/css/main.f6418f8a.chunk.css:1 Failed to load resource:

net::ERR_FILE_NOT_FOUND

1.13eeb203.chunk.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND

main.1e6014ca.chunk.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND

/favicon.ico:1 Failed to load resource: net::ERR_FILE_NOT_FOUND

This error was received after the following commands:

create-react-app whatiswrong

npm run build

Then open the index.html in my browser like I would for any other react apps I've built.


Solution

  • You need to add "homepage": "./" to your package.json.

    From: https://github.com/facebook/create-react-app/issues/6275#issuecomment-457813277