I have deployed a React project to Netlify. The project build works perfectly on my localhost and no errors pop up, however, after deploying to Netlify all I get is a blank screen. [Repo link] [Here is the live site]
Deploy log:
8:22:24 AM: Creating deploy upload records
8:22:25 AM: Starting post processing
8:22:25 AM: Post processing - HTML
8:22:25 AM: Post processing - header rules
8:22:25 AM: Post processing - redirect rules
8:22:25 AM: Post processing done
8:22:29 AM: Site is live
I cloned your repository and built it locally. After cloning and installing dependencies, I ran npm run build then serve dist (run npx serve dist if you don’t have serve installed globally). When I view the built site, I also see no content, so this indicates an issue with your app, not the way Netlify builds it.
I guessed as much but it does work fine when I run it locally. I just don’t know where else to look or what to change, I don’t see how I can identify the issue. Any pointers would be very helpful.
I have made some changes and at least the Home page does display now. It had something to do with the base directory in vite.config.js. However, now the next problem I’m facing is that whenever I click on one of the links I have on my Navbar, I get a 404 page. I’m routing with react-router. Any idea what this could be? I have added a netlify.toml file to my root directory with the following configuration:
[[redirects]]
from = “/*”
to = “/index.html”
status = 200