Vue · VUE0053
Route redirects must not form a cycle
Flags static route records whose redirects lead back to themselves.
Run this rule
pnpm vite-doctor . --framework vue --rules vue/router/no-redirect-cycle
Why it matters
vue-router follows record redirects without a limit, so a cycle of static redirects never resolves and navigation to any member hangs or overflows the stack.
Recommended fix
Point one record in the cycle at a route that renders a component, or remove the redundant redirect.
Useful links
Example
End the redirect chain at a page
Before
createRouter({
history: createWebHistory(),
routes: [
{ path: '/old', redirect: '/new' },
{ path: '/new', redirect: '/old' },
],
})
After
createRouter({
history: createWebHistory(),
routes: [
{ path: '/old', redirect: '/new' },
{ path: '/new', component: NewPage },
],
})