https://codesandbox.io/s/vue-router-v4-reproduction-l5fzm?file=/index.html
Получение ошибки
Uncaught TypeError: невозможно прочитать свойство 'listen' undefined в createRouter (vue-router.esm-bundler.js: 2269) в main.js: 16 createRouter @ vue-router.esm-bundler.js: 2269 (анонимно) @ main .js: 16
Пример кода: как воспроизвести
const { createRouter, createWebHistory, createWebHashHistory } = VueRouter
const { createApp } = Vue
const Home = {
template: `<div>home</div>`,
}
const Foo = { template: '<div>foo</div>' }
const Bar = { template: '<div>bar</div>' }
const router = createRouter({
routes: [
{ path: '/', component: Home },
{ path: '/foo', component: Foo },
{ path: '/bar', component: Bar },
],
})
const app = createApp({})
app.use(router)
window.vm = app.mount('#app')