Hi, Do you know I also encounter this error some months ago. It serve my page at first instance and if you refresh the page aside from the homepage it throws a 404 page. This almost causes an issue between me and my client because the deadline has passed and am yet to deliver his job, I later took the site to Heroku where I bundled the backend and frontend together and it works perfectly fine there. But to my surprise, I encounter the same error today again which almost pissed me off then but I was able to conquer the error today. oh my gosh! joy overwhelmed me. How I solved the error?.
I Import HashRouter from React-router-dom instead of BrowserRouter. I get to know browser router is used when your app routes were backed by a server and the hash-router is used when everything to your app is from the frontend. Try it, dude, it works!
ok but then how do i tell netlify, when i dont specify a root folder so it uses the entire repo which has index.html in the root, to look in the root folder for index.html? why isnt it finding it?
@jwhitty Absent instructions to the contrary, Netlify should pick up the root folder of the repository. If there is an index.html file there, it should display. If not, have you tried downloading your deploy folder to verify that your files are where you think they are?
I’m also facing the issue. The deploy works fine. Once I tried visiting the page, it says This site can’t be reached. When I visit using the Cognito the first time, it works then stops once I refresh.
I’ve downloaded the deploy and my index.html is sitting on the root level.
Please, I need help with this
Hi Luke,
Please, I need help on my site. It says ‘This site can’t be reached’ when I visit the webpage. Deploy works fine and the index.html is also sitting on the root level of the project.
When I tried visiting using Cognito, it works until I tried to refresh the page and it stopped working.
Please, I need help with this.
I changed the publish directory from /dist to / and it is working now. other examples all refer to the build directory/publish dir linking to the build folder, but that didnt seem to work for me
@sadewole You site loads for me here in Southern California, but it’s huge. The page code is more than five megabytes and there are calls to dozens of external assets. After a couple of refreshes, the page did fail to load, though, and there is a broken link/route.
I can’t determine why your page would not load on after a couple of refreshes, but I would think that reducing the sheer size of your code base would be a good first step in trying to fix this issue.
Umm so I don’t know why I’m getting this error, my site got deployed and it even loads but if I try to load it by the routes then it shows me that “page not found” error.
For example these are some of the routes my site has