I'm making a project using vite which uses vue-router@4. It works all fine but when viewing the links on vercel or netlify, i get a 404 error. Here is my index.js file (setup for router)
import { createRouter, createWebHistory } from "vue-router";
import Home from "../views/Home.vue";
import Admin from "../views/Admin.vue";
import List from "../views/List.vue";
const router = createRouter({
history: createWebHistory(),
routes: [
{
path: "/",
component: Home,
},
{
path: "/adminpanel",
component: Admin,
},
{
path: "/list",
component: List
}
],
});
export default router;
Am I doing anything obviously wrong? Thanks for your help.