Vue · VUE0053

Route redirects must not form a cycle

Flags static route records whose redirects lead back to themselves.
VUE0053vite-doctor/vueroutingerrorSuggestion

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.

Point one record in the cycle at a route that renders a component, or remove the redundant redirect.

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 },
  ],
})
Copyright © 2026