ReactJS Build returns empty page - reactjs

I am trying to deploy my React app that I created on Firebase hosting. But the problem is that when I run the npm run build command it builds the project correctly but when I open index.html it returns empty page. What should I do?
Please, find this empty page here: https://tutorm-db33prg.firebaseapp.com
It seems as it's not importing the main.js file but I don't know if that's the problem?
Thank you in advance!

Related

React app isn't sending app file to root div

I'm building a MERN stack application and am currently having an issue with getting the the front end content to display while running npm run develop.
The index.html file I'm using is the standard template of create-react-app and my index.js file uses ReactDom.render with and document.getElementById('root').
react and react-dom are both version 17.0.1.
I can't see why this wouldn't work but when I enter npm run develop in the terminal, I receive a blank screen and the devtools show that <div id='root> is completely empty but the only error I have in my console log is a GraphQL syntax error. It can see the index file, along with my css files, pages and components but the app isn't displaying on the page.
I've tried importing different versions of react and react-dom, deleted and remade my index.html and index.js, substituting different content into the JSX app element, redoing my npm installs to see if something had gone wrong there and just about everything else I can think of but the result is always the same. On top of that I have run other apps with the same setup on my laptop and they work fine.
If anyone has encountered a similar problem, advice would be welcome.

why my react css is not working in local host after trying to build and deploy?

hey I created a react app and it worked fine until I tried the process to make it deploy in react and now when I run npm start it is showing only the html page and react functionalities but all my css is missing ,I just only changes package.json file to deploy it in git, can anyone help me in this ?

Netlify Not Rendering React Component

Here is the link to my React project https://github.com/Count-T/blogfrontend, I ran npm run build and put that folder into netlify but when I check the app it only shows a blank page. I don't know is the problem is react-router but I already put a file to redirect netlify to index.html. This is my second time uploading a project onto netlify but my previous project did not use react-router-dom. Any help would be much appreciated thanks!
Link to netlify website: https://tonyliblog.netlify.app/
Here is an image of the website
I do see an error "Cannot convert undefined or null to object" in the console on the netlify site. I don't know if that could help you to pin down the issue. Did it run without any problem in your local env? Are you using any environment variables/ Keys to access your API?

i made first react app and when i upload it on github i only see blank page on github page

hi so im trying to upload page made in react to github at start i ran into problem of it showing me only README file but i managed to solve that by following deployment guide on react website and that help well kind of, now i ran into other problem which is that github is just showing me blank page i don't understand why is it like this cuz i changed file and it shouldn't be empty and here is git repository for non- npm build version of page and also here is git repo for the build version of page that is just blank, am i running in this problem cuz i used npm build wrong way? how do i fix it? thanks in advance
I had the same problem and I found easier to use Netlify to upload websites.
I think if you are using only an html file you can just set the github pages with root and it shouldn't reuqire to use build run, I think the build command it is for projects done with frameworks/more complext. Try to do like that maybe it will work.

When using Github pages and React how do you deploy to the homepage, i.e. https://username.github.io/?

All the examples I see online have you deploy to a subdomain (for example https://username.github.io/my-app). But how do you deploy to the homepage when using React? In my package.json file I have "homepage": "http://username.github.io/" and I'm using npm run deploy however my site doesn't show up, instead a React information file displays.
Any help would be greatly appreciated.
I figured out what I need to do after reading the 'Github Pages' section of this website: https://create-react-app.dev/docs/deployment/.

Resources