"Page Not Found" / "404: NOT_FOUND" when you refresh or open a deep link in your deployed React app

Exact error
Page Not Found
Also appears as (2)
  • 404: NOT_FOUND
  • 404 on refresh (React Router single-page app)
Partially verified CI: pending

We reproduced the error and verified part of the fix; the parts we could not test are listed on the page. How we verify.

Last verified
Re-test due
Published
Repro
19 files, hashes public
Fix ID
APP-02
Environment and versions
osDebian 13 (container)
node20.19.2
vite8.3.5
react19.3.1
react-router-dom7.18.4
netlify-cli27.14.2 (offline emulator)

In brief

Your single-page app needs a fallback rule on the host. The full fix gives the exact file and line for Netlify and Cloudflare Pages, the Vercel equivalent, and when NOT to use it.

Get the full fix ↓

Symptom

Your Lovable, Bolt or Cursor app (React + Vite + React Router) deploys fine and the home page loads. But when you refresh on /dashboard, or someone opens a shared link to it, they get Netlify's "Page Not Found" or Vercel's "404: NOT_FOUND".

Why it happens

  • Your app is a single-page app (SPA). The only real HTML file is index.html; pages like /dashboard exist only inside your JavaScript.
  • Clicking a link works because React swaps the page without asking the server.
  • A refresh asks the server for a file called /dashboard, which doesn't exist, so the server returns 404.

What we could not test

  • Real Netlify or Vercel deploys (no accounts).
  • vercel.json rewrites, because vercel dev needs a login.
  • Cloudflare Pages, GitHub Pages and Azure.

The full fix

$4

The free part of this page tells you what's wrong. The full fix tells you exactly what to do. It includes:

  • Step-by-step fix, safest option first (the full page is 432 words)
  • 1 copy-paste block of commands, config or code
  • How to check it worked
  • Our test record from Oct 26, 2026: what we ran and what happened

Launching soon. Checkout isn't open yet; prices may change at launch. Join the waitlist. You can check what you'll get: SHA-256 of the full fix 03c45d60dc667da8… (how to check).

Sources

  1. Stack Overflow: Netlify renders 404 on page refresh
  2. Stack Overflow: Page Not Found ... deployed on Netlify
  3. Stack Overflow: Vercel project 404 on refresh
  4. r/lovable: Lovable website shows Page Not Found on Netlify
  5. Netlify docs: redirects (file goes in the publish directory)
  6. Netlify support guide: I've deployed my site but I still see Page not found

How this page was made

Drafted by an AI agent and reproduced on our test machine on Oct 26, 2026. The scripts and logs are in the repro bundle; their file hashes are public on the repro page. Human review: not yet. No warranty: try fixes on a copy or staging environment first. Machine-readable versions: Markdown · JSON.

Found a mistake or a newer version where this breaks? Tell us.