Common errors · Lovable, Bolt, Vite + React Router on Vercel, Netlify, Railway
Lovable or Vite app: 404 on refresh or on a direct link after deploy
Cause The host looks for a file at that path and only index.html exists: single-page apps need a fallback.
Fix Add the rewrite to index.html for your host (vercel.json, public/_redirects, or a Node fallback).
Have it fixed for you, 290 EURSee the fix step by step
The home page loads, navigation inside the app works, but reloading any other page or sharing its link gives a 404. The host looks for a file called /dashboard and there is none: only index.html exists.
Where it breaks
Which case is yours?
- A single-page app needs the host to answer every unknown path with index.html, and static hosts do not do that by default.
The fix, step by step
- Vercel: add vercel.json at the project root.
{ "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }] } - Netlify: add public/_redirects (Vite copies public/ into dist/).
/* /index.html 200 - Railway or any Node host: serve dist with a fallback.
npx serve -s dist -l $PORT - Keep real 404s: add a catch-all route in React Router that renders a not-found page, otherwise every typo returns your home page with a 200.
How to check it is fixed
Open https://your-domain/dashboard in a private window: the page renders. curl -I on a missing asset still returns 404.
Delivery example for this error
- (no rewrite: /dashboard is 404)+ "rewrites": [{ "source": "/(.*)",+ "destination": "/index.html" }]- Root cause: The host looks for a file at that path and only index.html exists: single-page apps need a fallback.
- Change made: Add the rewrite to index.html for your host (vercel.json, public/_redirects, or a Node fallback).
- Open https://your-domain/dashboard in a private window: the page renders. curl -I on a missing asset still returns 404.
Illustrative: the real diff is written against your repository. Full sample report
Still stuck on your own code?
Send the repository and the exact error. Fix: 290 EUR all taxes included, delivered within 72 hours, refunded if not resolved.
Not sure it is this error? Ask for a free written diagnosis, no card needed.