404 "NOT_FOUND" on after vite deployment

I deployed a vite app on vercel , the deployment was successful, but when I visit a particular route it shows 404 Not Found Error

Deployment State

404 “NOT_FOUND” Error on page

I’m using typescript with vite and in tsConfig I have mentioned
rootDir: “./src”
outDir: “./dist”

so vite makes build on dist folder on root directory as I have shown in screenshot below

I have used this configuration in vercel.json

{
  "rewrites": [
    { "source": "/(.*)", "destination": "/dist/index.html" }
  ]
}

These are my project settings


PS: I’m using react-router-dom for route handling in vite app

There’s another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes.

A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0.

Hi, @atul654! Welcome to the Vercel Community :wave:

Did you go through our 404 community post? Might be helpful for you to debug!