React Router Not Working on Page Refresh After Deploying Vite App on Render

I’m using Vite with React and deploying my application on Render. Everything works fine, but when I refresh the browser on any route other than the home page, I get a “Not Found” error. I’m using React Router DOM for routing. What is causing this issue, and how can I fix it so that all routes work properly even after a browser refresh?

Hi there,

Have you added the rewrite to have client-side routing work: https://docs.render.com/deploy-create-react-app#using-client-side-routing

Regards,

Keith
Render Support, UTC+10 :australia: