Skip to content
Discussion options

You must be logged in to vote

You need to use the experimental router:

import { createWebHistory } from 'vue-router'
import { experimental_createRouter as createRouter } from 'vue-router/experimental'
import { handleHotUpdate, resolver } from 'vue-router/auto-resolver'

export const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  resolver,
})

if (import.meta.hot) {
  handleHotUpdate(router)
}

And also manually register RouterLink and RouterView in main.ts:

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { RouterLink, RouterView } from 'vue-router'

const app = createApp(App)

app.component('RouterLink', RouterLink)
app.component('Router…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@OwenVey
Comment options

@posva
Comment options

Answer selected by posva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2621 on February 11, 2026 06:34.