I am currently utilizing vue-router within my vue application. The application consists of the following routes:
const routes = [
{name: "home", path: "/", component: Home},
{name: "user", path: "/user", component: User},
{name: "edit-user", path: "/user/edit", component: EditUser}
];
const router = new VueRouter({
routes: routes,
mode: 'history'
});
When accessed using router-link
, both routes work flawlessly as shown below.
<router-link to="/user">Go to user</router-link>
<router-link to="/user/edit">Edit user</router-link>
However, if I try to access the routes directly by refreshing the page, the "/user" route works perfectly fine. On the other hand, the "/user/edit" route displays a black page with a console error message stating the following: (no additional error information provided).
Uncaught SyntaxError: Unexpected token <
I am in need of assistance to resolve this issue. Any help would be greatly appreciated.