{"record":{"id":"01221ac0ecea7af6","repo":"vuejs/vue-router","slug":"props-in-route-path-is-a-typeof-config-ex","errorCode":null,"errorMessage":"props in \"${route.path}\" is a ${typeof config}, expecting an object, function or boolean.","messagePattern":"props in \"(.+?)\" is a (.+?), expecting an object, function or boolean\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/components/view.js","lineNumber":148,"sourceCode":"        delete propsToPass[key]\n      }\n    }\n  }\n}\n\nfunction resolveProps (route, config) {\n  switch (typeof config) {\n    case 'undefined':\n      return\n    case 'object':\n      return config\n    case 'function':\n      return config(route)\n    case 'boolean':\n      return config ? route.params : undefined\n    default:\n      if (process.env.NODE_ENV !== 'production') {\n        warn(\n          false,\n          `props in \"${route.path}\" is a ${typeof config}, ` +\n          `expecting an object, function or boolean.`\n        )\n      }\n  }\n}\n","sourceCodeStart":130,"sourceCodeEnd":156,"githubUrl":"https://github.com/vuejs/vue-router/blob/680ccc68c506cca9be6207745043245d61fa715a/src/components/view.js#L130-L156","documentation":"When navigating by name (router.push({ name }) or :to=\"{ name }\") the matcher looks the name up in nameMap. In dev mode, if no route record has that name, warn() logs \"Route with name 'x' does not exist\" and the router falls back to creating an empty/failed route match (no navigation occurs). This is vue-router 3's dev-time signal for a typo'd or unregistered named route.","triggerScenarios":"router.push({ name: 'Home' }) where no route was defined with name: 'Home'; case mismatches ('home' vs 'Home'); navigating before routes are registered (addRoutes not yet called); renamed routes after refactor.","commonSituations":"Typos in route names; routes added dynamically via router.addRoutes() after an async init but navigated to earlier; using names from a different router instance; upgrades where route names changed.","solutions":["Fix the route name in the push/to call to exactly match a registered route's name (names are case-sensitive).","Ensure the route is registered before navigation — register it in the routes array or call addRoutes before pushing.","Guard programmatic navigation: check the route exists (e.g. via router.resolve({ name })) or add a beforeEach to detect unmatched routes.","In production, also handle the resulting empty match (e.g. a catch-all 404 route)."],"exampleFix":"// before\nrouter.push({ name: 'usr-profile', params: { id: 1 } })\n// routes: [{ path: '/user/:id', name: 'userProfile', component: User }]\n// after\nrouter.push({ name: 'userProfile', params: { id: 1 } })","handlingStrategy":"validation","validationCode":"// before navigating by name, verify it resolves\nfunction routeNameExists (router, name) {\n  const resolved = router.resolve({ name })\n  return resolved && resolved.route && resolved.route.matched.length > 0\n}\nif (routeNameExists(router, 'userProfile')) router.push({ name: 'userProfile' })","typeGuard":"function isNamedLocation (loc) {\n  return !!loc && typeof loc === 'object' && typeof loc.name === 'string' && loc.name.length > 0\n}","tryCatchPattern":"try {\n  const resolved = router.resolve({ name: 'userProfile' })\n  if (!resolved.route.matched.length) throw new Error(\"Route with name 'userProfile' does not exist\")\n  router.push({ name: 'userProfile' })\n} catch (e) {\n  router.push('/404')\n}","preventionTips":["Centralize route names as constants to avoid typos and case mismatches.","Register all routes before any programmatic navigation (await dynamic setup, then addRoutes).","Add a catch-all 404 route so unmatched navigations are handled in production too.","Keep names unique; duplicate names overwrite entries in nameMap."],"tags":["vue-router","named-routes","navigation","routing"],"backgroundTag":"route-name-not-found","analyzedSha":"680ccc68c506cca9be6207745043245d61fa715a","analyzedAt":"2026-09-02T19:19:01.204Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}