Scripts not being loaded

[](http://the site);

Hi, I’m using create-react-app. I can deploy the site locally using npm start. The repo is here .

On the web console, it states the scripts were not loaded since it was in a format not read by javascript.There was no issue in the deploy log.

Hi, @Rubens. If I curl the URL above I get the following HTML:

<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="shortcut icon" href="/book-reader/favicon.ico"><link rel="stylesheet" href=",700"><title>MyReads</title><link href="/book-reader/static/css/main.90eefabd.css" rel="stylesheet"></head><body><div id="root"></div><script type="text/javascript" src="/book-reader/static/js/main.05db535a.js"></script></body></html>

The javascript file path above is /book-reader/static/js/main.05db535a.js. That URL is a 404:

$ curl -svo /dev/null  2>&1 | grep -i "< HTTP/"
< HTTP/2 404

That is because the resource is actually located at this URL:

$ curl -svo /dev/null  2>&1 | grep -i "< HTTP/"
< HTTP/2 200

The solution here will be to change the path being outputted in the HTML to exclude the “/book-reader” from the path to the file.

You can download the deployed files to confirm this as well. (There is more information about downloading the deployed site files from Netlify here.)

I’m not sure why “book-reader” is being included in the page but removing that will resolve the issue. I hope the information above helps. If there are other questions about this, please let us know.

1 Like

I believe it’s the way Create-React-app default config is that includes the “book-reader” portion.