Why my react build app not working in Namecheap server? - reactjs

Recently, I made a website using react and hosted on Hostinger and it worked properly. Then I shifted to Namecheap for some reason. And the same build file(which I uploaded on Hostinger) worked in Namecheap too. But when I re-upload my new build file with some update of my website, it crashed. It show's only blank page. Sometimes it working in some browser and sometimes not.
The build file which I re-uploaded on Namecheap working on netlify server (easytopupbdtest.netlify.app) but not on Namecheap. Then I thought that Namecheap has problem maybe, that's why my application is not running. Then again I changed my IP address and nameservers and pointed to the Hostinger. But it also not worked! I mean, the same build file which worked before I shift to the Namecheap.
Image of the main website when it is hosted on Namecheap server:

Related

firebase deployment after redirect below page

enter image description here
I want to host my app on firebase.
I followed these steps.
npm run build and it created build folder
firebase init, select hosting,
What do you want to use as your public directory? build
Configure as a single-page app (rewrite all URLs to /index.html)?
Yes
File build/index.html already exists. Overwrite? No
and then finally firebase deploy
after some time I see files uploaded successfully and in the firebase hosting dashboard it shows files uploaded something like 727. but the app looks something like a welcome message "Welcome Firebase Hosting Setup Complete. You're seeing this because you've successfully set up Firebase Hosting. Now it's time to go build something extraordinary!"
however, if I create a react app using create-react-app, and follow the same steps, it's working fine at the same URL and host. it displays the app at once without a problem.
my firebase.json
Firsty once you deploy it try viewing it on incognito mode as sometimes due to the cache it renders the same page
now still if you have errors follow this steps given in the link I followed this and got mine online
https://www.youtube.com/watch?v=IDHfvpsYShs&t=337s

Can't deploy react app (issues with build folder)

So I have built a react app from scratch using npx create-react-app. Everything was going great and I decided to deploy it, to which I hit a lot of problems. Using BlueHost has the host, I accessed the CPanel and inserted the build folder, which i used npm run build to create. The website loaded correctly on chrome, however issues within Safari and Mobile browsers emerged, the page was empty.
After doing further research, I decided that the issue was in deployment and not dependencies. I came to this conclusion because I was able to run a local server on both Chrome and Safari, to which the website worked. If it was a dependency issue, it would not have worked on the local server.
So, I decided to start debugging the build folder. However, this is where an issue emerged, I could not load it at all on a server. I tried using serve -s build, but that directed me to an error screen, 404: the requested path could not be found. If I try to plainly use the index.html, open with browser method on my build, it directs my to an empty page with an invalid url, file:///Users/danieldobrovolskiy/Documents/optimal-exterior/build/index.html.
Apologies if my question is vague or incoherent in someway. I'm seriously confused with the deployment process and have no idea what to even ask. All help is appreciated! Let me know if further information is needed.[
Have you set a homepage in package.json? it should be like "homepage": "./" if you're deploying off the main folder of the webserver

How can I deploy React App to GoDaddy domain

I am new to using Reactjs, I just finished a project for a client and I need to upload it to a domain on GoDaddy. I ran npm run build already and I now have a build folder. I'm just not sure how to proceed. Can somebody please help me?
A domain name is not enough, you need to host your application somewhere. You can use netlify or zeit (both have free tiers) to deploy your application. After deploying the app you can link your domain to navigate to the application.
There's a few options, but heres a simple one to get you up and running quick. Upload to github repo and link your github account to netlify. In the netlify account deploy your project which will show at a random netlify domain. Change the nameservers in netlify to point to your godaddy domain and your app is live.

Can i host/deploy React application in iis server?

I am new to React. I have created a simple React application. I wanted to explore deployment and hosting options for React. I have worked previously in Angular and it can be deployed in IIS. can we do the same for React. Please enlighten me.
According to your description, I suggest you could follow below steps to host or publish the application to IIS.
1.Open cmd and locate your react application folder
2.Build the project to production folder.
npm run build
3.Open IIS management console and create a new web sites and use the build path as the physical path. for example: D:\ReactAppTest\my-app\build
Notice: You should pay attention to your port number.
4.Then you could use that port number to access your react application. For example: http://localhost:9965/

Uploading React app to an external server

I'm completely new in React world.
A few days ago I developed my very first simple React app, built the app and uploaded it to my GoDaddy host. I thought this would be enough as I had an index.html in the root of my host and the thought that the build will work once I open my domain in browser.
Unfortunately, it turned out that it's not working. Nothing is easy in life.
After hours of googling I found out that people upload their React apps to special services such as Heroku. I found a tutorial and managed to publish my react app successfully on Heroku. But to be honest I still don't know why my app wasn't working on GoDaddy server.
When I was preparing my app for Heroku, one step was creating a server.js file using express.js.
Does it mean that each React app needs such a server file to be working? What if I wanted to use my React app on GoDaddy or any other hosting server? Would it be possible?
OK, I found out what was the problem.
It turned out that paths inside the index.html don't mirror the build folder structure.
Inside the index.html I had to change references like this:
/static/css/2.567.chunk.css
To this:
./static/css/2.567.chunk.css
And inside of CSS files I needed to change paths like this:
/static/media/tree.6098.jpg
To this:
../media/tree.6098.jpg
After that you simply upload your files and everything works as it should.
Now the question is, why those paths are not as they should be?

Resources