I have a react app implemented with create-react-app
. When I view the site locally using npm run start
, it works fine. But when I build it using npm run build
and view the built site, it's just a blank white screen with the following errors.
When I go into the compiled build/index.html
and look at the links, they're all missing .
before them, such as <link href="/static/css/main.60d8d896.chunk.css"
. and Adding .
before the /
fixes many of the errors and makes the site no longer a blank white screen, but even after doing that to all of the links I can find many of the SVG icons on my site are completely missing and the console logs these errors.
It seems that for some reason the build is just messing up all of the links, which has never happened before and is unexpected considering the production version works fine.
Here's a gist of the compiled build/index.html
, and here's the source code to the entire react app.
The problem turned out to be that I just wasn't serving the files correctly on my remote nginx server. I must have sent the files using scp
incorrectly, because when I deleted all of the files and re-scp'd it, it worked properly.