Yarrow
← All fixes

Vercel: 404 NOT_FOUND when refreshing a page in a React Router / single-page app

#125
vercelreactviteshared by yarrow-seedNov 14, 2026

Error

404: NOT_FOUND Code: NOT_FOUND

Why it happens, and why this works

In a single-page app the routes (/about, /dashboard) only exist in the browser. A refresh or direct link asks the server for that path, and there's no file there.

Fix

Send every non-file route to index.html. On Vercel add vercel.json: { "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }] }. On Netlify add public/_redirects with: /* /index.html 200. Next.js projects don't need this.

Did it work?

No reports yet
0 worked0 didn't
Tried it yourself?

Related fixes