{"record":{"id":"490623a8733df77a","repo":"vuejs/devtools-v6","slug":"vue-devtools-no-routes-found-in-router","errorCode":null,"errorMessage":"[Vue Devtools] No routes found in router","messagePattern":"\\[Vue Devtools\\] No routes found in router","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/app-backend-vue2/src/plugin.ts","lineNumber":67,"sourceCode":"    if (app.$router) {\n      const router = app.$router\n\n      // Inspector\n\n      api.addInspector({\n        id: ROUTER_INSPECTOR_ID,\n        label: 'Routes',\n        icon: 'book',\n        treeFilterPlaceholder: 'Search routes',\n      })\n\n      api.on.getInspectorTree((payload) => {\n        if (payload.inspectorId === ROUTER_INSPECTOR_ID) {\n          if (router.options.routes) {\n            payload.rootNodes = router.options.routes.map(route => formatRouteNode(router, route, '', payload.filter)).filter(Boolean)\n          }\n          else {\n            console.warn(`[Vue Devtools] No routes found in router`, router.options)\n          }\n        }\n      })\n\n      api.on.getInspectorState((payload) => {\n        if (payload.inspectorId === ROUTER_INSPECTOR_ID) {\n          const route = router.matcher.getRoutes().find(r => getPathId(r) === payload.nodeId)\n          if (route) {\n            payload.state = {\n              options: formatRouteData(route),\n            }\n          }\n        }\n      })\n\n      // Timeline\n\n      api.addTimelineLayer({","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/vuejs/devtools-v6/blob/dd2ab5d4275187cbd81952a2a3d53c335643c1f4/packages/app-backend-vue2/src/plugin.ts#L49-L85","documentation":"The Vue Router inspector for Vue 2 apps builds its tree from `router.options.routes`. When a router instance has no `routes` in its options (e.g. created with addRoute-only or an unusual config), the inspector logs this warning with the router options and shows an empty tree. It indicates the inspector cannot render the route table.","triggerScenarios":"getInspectorTree with inspectorId ROUTER_INSPECTOR_ID while the connected Vue 2 app's router was created without a `routes` array in `new VueRouter({...})` — routes added exclusively at runtime via addRoute, or options stripped by a custom router wrapper.","commonSituations":"Apps registering all routes dynamically at runtime; routers built by wrappers/meta-frameworks that omit the static routes array; config migration mistakes where the routes option was renamed or removed.","solutions":["Pass a `routes` array to the VueRouter constructor so the static options always exist.","If routes are dynamic, seed the router with a minimal routes array and keep addRoute entries mirrored in options, or accept an empty inspector tree.","Inspect the logged `router.options` in the console to see what the router actually received and fix the config source.","Update vue-router/devtools packages — newer versions may fall back to router.getRoutes()."],"exampleFix":"// before\nconst router = new VueRouter() // no routes option\nrouter.addRoute({ path: '/a', component: A })\n\n// after\nconst router = new VueRouter({ routes: [{ path: '/a', component: A }] })","handlingStrategy":"validation","validationCode":"if (!router.options?.routes?.length) {\n  console.warn('Router created without static routes; inspector tree will be empty')\n}","typeGuard":"function hasStaticRoutes(router) { return Array.isArray(router.options?.routes) && router.options.routes.length > 0 }","tryCatchPattern":null,"preventionTips":["Always pass a routes array to new VueRouter(...)","Mirror runtime addRoute calls into the initial routes config","Check the logged router.options in console to debug config wiring"],"tags":["vue-router","inspector","configuration","vue2"],"backgroundTag":"missing-router-routes","analyzedSha":"dd2ab5d4275187cbd81952a2a3d53c335643c1f4","analyzedAt":"2026-08-31T12:41:59.822Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}