Short answer
Your app is a single-page app: one index.html that handles every route in the browser. When you refresh /dashboard, the host looks for a file at that path, finds none and returns 404. Add a rewrite that serves index.html for every path: a _redirects file on Netlify, or a vercel.json rewrite on Vercel.
The fix for each host
01
Netlify: no rewrite to index.html
Netlify’s docs give one rule for single-page apps. Put it in a file named _redirects, with no extension, in your publish folder. In a Vite project (the default for Lovable and many Bolt apps; look for a vite.config file), save it as public/_redirects: Vite copies public/ into the root of dist, so it ships with every build. Real files such as images and scripts still load, because the rule doesn’t override files that exist.
# public/_redirects /* /index.html 20002
Vercel: no rewrite in vercel.json
Vercel’s Vite guide says deep linking won’t work out of the box for a single-page app. Add a vercel.json at the root of the project with a rewrite to index.html, then redeploy.
{ "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }] }03
The rule exists but never ships
Unless your repository root is also the publish directory, a _redirects file at the root isn’t published, so Netlify never sees it. Check that the publish directory is your build output folder (dist for a default Vite app) and that _redirects is inside it after the build. Some build tools skip files whose names start with an underscore, so look in dist to be sure. On Vercel, vercel.json has to sit at the project root, the folder set as the project’s root directory.
Checked against the vendor’s docs on : Netlify docs: Rewrites and proxies (history pushstate and single-page apps); Netlify docs: Redirects and rewrites; Vercel docs: Vite on Vercel; Vite docs: The public directory.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.See scope and start
Related: Bolt or Lovable build fails on deploy · Lovable, Bolt and Replit app fixes