I also face the same issue ,it resolve when you have put the correct path in your config file for base :
const viteConfig = {
plugins: [react(), svgr()],
base: "./",
server: {
port: 3000,
open: true,
},
build: {
target: "esnext",
outDir: "dist",
sourcemap: true,
rollupOptions: {
output: {
manualChunks: {
vendor: ["react", "react-dom"],
},
},
},
},
};