Any help would be GREATLY appreciated. Thank you!
I can run my website fine locally, but am having problems when deploying it in production. When I run npm run deploy
, it should automatically build into production.
Here's part of my package.json
for the deploy command:
{
"name": "barrex",
"version": "0.1.0",
"homepage": "https://patrickhuang94.github.io/barrex",
"devDependencies": {
"gh-pages": "^0.12.0",
"react-scripts": "0.9.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"deploy": "npm run build&&gh-pages -d build"
}
}
Everything on my gh-pages
is set up correctly. When I run the URL I specified in my 'homepage' field (Barrex), it's redirecting to my custom domain. But my custom domain can't find the .js files that was supposed to be created with npm run deploy
. Can someone explain why it runs ok on local machine, but can't find resources in production?
As it says in the screenshot, the project was built assuming it would be hosted at /barrex/
.
However you are serving it from the server root.
Change homepage
in package.json
to your custom domain (http://www.barrexus.com/
). Next time you build, it will infer /
as the path project is hosted on, and use that instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With