{"record":{"id":"f54ac8c1c28cc9f8","repo":"framework7io/framework7","slug":"framework7-there-is-no-view-with-anotherviewna","errorCode":null,"errorMessage":"Framework7: There is no View with \"${anotherViewName}\" name that was specified in this route","messagePattern":"Framework7: There is no View with \"(.+?)\" name that was specified in this route","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/modules/router/navigate.js","lineNumber":679,"sourceCode":"      .replace('///', '/')\n      .replace('//', '/');\n  }\n  if (createRoute) {\n    route = extend(router.parseRouteUrl(navigateUrl), {\n      route: extend({}, createRoute),\n    });\n  } else {\n    route = router.findMatchingRoute(navigateUrl);\n  }\n\n  if (!route) {\n    return router;\n  }\n  if (route.route && route.route.viewName) {\n    const anotherViewName = route.route.viewName;\n    const anotherView = app.views[anotherViewName];\n    if (!anotherView) {\n      throw new Error(\n        `Framework7: There is no View with \"${anotherViewName}\" name that was specified in this route`,\n      );\n    }\n    if (anotherView !== router.view) {\n      return anotherView.router.navigate(navigateParams, navigateOptions);\n    }\n  }\n\n  if (route.route.redirect) {\n    return redirect.call(router, 'forward', route, navigateOptions);\n  }\n\n  const options = {};\n  if (route.route.options) {\n    extend(options, route.route.options, navigateOptions);\n  } else {\n    extend(options, navigateOptions);\n  }","sourceCodeStart":661,"sourceCodeEnd":697,"githubUrl":"https://github.com/framework7io/framework7/blob/655759126686766530a027b2f8f369c991d63d1c/src/core/modules/router/navigate.js#L661-L697","documentation":"Routes can declare `viewName` so navigation is redirected to a specific View. During `navigate`, if the route specifies a viewName and no View with that name is registered on the app, the navigation throws because the target View does not exist.","triggerScenarios":"A route definition like `{ path: '/stats/', viewName: 'stats' }` while `app.views.stats` was never created or was created under a different name.","commonSituations":"Typo in viewName vs the name passed to `app.views.create(..., { name })`; the target View was removed/destroyed at runtime; route config copied from a multi-view demo without creating the views.","solutions":["Create the referenced View with the exact name: `app.views.create('.view-stats', { name: 'stats' })`","Fix the viewName in the route to match an existing View's registered name","Remove viewName from the route if it should navigate in the current View","Check Object.keys(app.views) to confirm which view names exist"],"exampleFix":"// before\nroutes = [{ path: '/stats/', viewName: 'stats' }]; // no view named 'stats'\n\n// after\napp.views.create('.view-stats', { name: 'stats' });\nroutes = [{ path: '/stats/', viewName: 'stats' }];","handlingStrategy":"validation","validationCode":"if (route.route && route.route.viewName && !app.views[route.route.viewName]) {\n  throw new Error(`View \"${route.route.viewName}\" referenced by route does not exist`);\n}","typeGuard":"function viewExists(app, name) {\n  return !!app.views && Object.prototype.hasOwnProperty.call(app.views, name);\n}","tryCatchPattern":"try {\n  router.navigate('/stats/');\n} catch (e) {\n  if (/no View with/.test(e.message)) {\n    console.error('Create the named View or fix route.viewName');\n  } else throw e;\n}","preventionTips":["Keep route viewName values in sync with app.views.create names","Validate all route viewNames against app.views at startup","Avoid creating views conditionally that routes depend on","Single-source view names in a constants file"],"tags":["router","view","configuration","framework7"],"backgroundTag":"missing-named-view","analyzedSha":"655759126686766530a027b2f8f369c991d63d1c","analyzedAt":"2026-09-02T19:48:40.711Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}