Failed to deploy react app on github pages, netlify and heroku - reactjs

I am trying to deploy my react app but its not deploying anywhere, I have tried on Github pages, Heroku and Netlify. This is the repo link please someone help.
LINK:- https://github.com/harsh021102/hackat1

Heroku works. https://murmuring-anchorage-77354.herokuapp.com/
1- remove "homepage" from your package.json
2- npm run build
3- copy example project https://github.com/aydink88/heroku-express-spa
4- replace the example project build folder with your build folder
5- push only the express project repo to heroku (netlify and github doesn't work this way)

Related

React fails to make build with default app

React fails to make proper build, even with default app.
I ran commands npx create-react-app my-app then npm run build.
When I open index.html in /build, the site doesn't work and I get following logs:
You can just open a React (or Angular) build by clicking on the HTML file.
What you have to do is the following:
Install any static server module (i.e. serve):
npm install -g serve
In the root directory:
serve -s build
And then your app will be served.
It would be wise to do that before you deploy to any cloud storage or even your own server, but if you are 100% your app works, you can just deploy in on Vercel, Heroku or GitHub pages, they are free.

How to deploy a react app with json-server without any server.js file?

here's my repo https://github.com/asujsi/user-list
I want to deploy it to heroku, I tried and failed.
Should I deploy both db.json and react project in separate repo please help

My react app in the gh-pages is only showing the read.me not the index.js;

My react app is not loading the index.js, you can see my repository at https://github.com/Vitorrrocha/Star-Wars-info and the gh-pages: https://vitorrrocha.github.io/Star-Wars-info/ .
package.json: https://github.com/Vitorrrocha/Star-Wars-info/blob/master/package.json
Which branch are you trying to serve as a GitHub page? I see you have just a master branch.
You could make a branch called gh-pages and push your build there. I see you have gh-pages installed as a devDependency. You can use gh-pages -d build it will do everything for you. (build is the output folder of react-scripts build.)

react) after deploy using github pages, there are nothing on the page

before deploy, on the localhost
after deploy, on the github pages: https://joo168.github.io/goal_tracker/
it's react.
before deploy, on the localhost, it works.
but after deploy using github pages, there are nothing on the page..
as you can see, NOTHING
why did it happen?
i did
yarn build
yarn run deploy
package.json

React deploy not serving images

I have an issue where I deploy my React app the images are not showing. Works fine locally. I've set the homepage to a GitHub site http://ryandixon555.github.io/react-board-game and run
npm build
then
npm deploy
but still no images. I've also specified the homepage in the package.json:
"homepage": "http://ryandixon555.github.io/react-board-game"
In the end I gave up and deployed using netlify, following this link and then copying my code over.

Resources