Not sure where to ask this but the build of the website is fine. The issue comes to loading pages on my website such as:
Page Not Found (cccsolutions.netlify.app)
They run perfectly fine locally, but usually load a lot of data from files stored on my computer (many different txt files). Does netlify just give page not found if the page takes too long to load in? I’m already noticing bad load times even on the solutions page compared to locally.
Below is the repo for the website I have deployed:
Tankman61/mmhs-website: Website re-design for Milliken Mills High School. Currently focusing on redesigning https://mmhs.ca/ccc/, and possibly moving on with other parts of the website. (github.com)
and here is the code for as to how pages like the one I have posted above are loaded: mmhs-website/frontend-react/mmhs-website/src/components/Solution.jsx at main · Tankman61/mmhs-website (github.com) .
I just don’t really understand why this wouldn’t work on the deployed version. Also, all txt files I’m getting data from are in the public folder.
@Tankman61 I don’t believe the issue is what you think it is.
It should be solved by my post here:
@vasawat77 This is an easy one.
Your app appears to be an SPA (Single Page Application), so the other “pages” don’t actually exist.
See the note here in the warning box that says Avoid 404s for SPAs:
You need to add the rewrite as demonstrated here:
It ensures requests for routes that don’t exist are served your applications main index.html file
If it’s unclear, here’s a more detailed explanation I gave previously:
Additional detailed explanation here:
@blogfreerecipe This is occurring because your site is a react based SPA (Single Page Application).
When you visit the site via the root / it is automatically loading the index.html which is your application, and then when you visit other pages you never actually leave the index.html page (it just looks like you do).
So /recipeDetails/110133d3dd574821a9ab17b9d160d06d loads in additional data and simulates a browser page change.
However when you make a fresh request for example by going to one…
2 Likes