[Vuejs]-Add route to my Laravel Vue project not working

0👍

I had the same issue as you. To resolve it, I checked file ""node_modules/vue/dist/vue.esm-bundler.js" and there isn’t export default in this file but is something like that: export { NavigationFailureType, RouterLink, ... };. Hence solution looks like that:

import { createApp } from 'vue';
import { createRouter, createWebHistory } from 'vue-router'
import { routes } from '.routes'

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

const app = createApp({})
    .use(router);
    
app.mount('#app');

Leave a comment