Returning 404 on page refresh vercel

Advertisements

I deploy a react, typescript project using Vite while refreshing getting a 404 error.

404: NOT_FOUND
Code: NOT_FOUND

>Solution :

Add this to your vercel.json file. Then push or deploy to vercel again.

{
  "routes": [
    { "handle": "filesystem" },
    { "src": "/.*", "dest": "/index.html" }
  ]
}

Leave a ReplyCancel reply