framework7io/framework7 · error · Error
Framework7: There is no View with "${anotherViewName}" name
Error message
Framework7: There is no View with "${anotherViewName}" name that was specified in this route What it means
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.
Source
Thrown at src/core/modules/router/navigate.js:679
.replace('///', '/')
.replace('//', '/');
}
if (createRoute) {
route = extend(router.parseRouteUrl(navigateUrl), {
route: extend({}, createRoute),
});
} else {
route = router.findMatchingRoute(navigateUrl);
}
if (!route) {
return router;
}
if (route.route && route.route.viewName) {
const anotherViewName = route.route.viewName;
const anotherView = app.views[anotherViewName];
if (!anotherView) {
throw new Error(
`Framework7: There is no View with "${anotherViewName}" name that was specified in this route`,
);
}
if (anotherView !== router.view) {
return anotherView.router.navigate(navigateParams, navigateOptions);
}
}
if (route.route.redirect) {
return redirect.call(router, 'forward', route, navigateOptions);
}
const options = {};
if (route.route.options) {
extend(options, route.route.options, navigateOptions);
} else {
extend(options, navigateOptions);
}View on GitHub (pinned to 6557591266)
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
Example fix
// before
routes = [{ path: '/stats/', viewName: 'stats' }]; // no view named 'stats'
// after
app.views.create('.view-stats', { name: 'stats' });
routes = [{ path: '/stats/', viewName: 'stats' }]; Defensive patterns
Strategy: validation
Validate before calling
if (route.route && route.route.viewName && !app.views[route.route.viewName]) {
throw new Error(`View "${route.route.viewName}" referenced by route does not exist`);
} Type guard
function viewExists(app, name) {
return !!app.views && Object.prototype.hasOwnProperty.call(app.views, name);
} Try / catch
try {
router.navigate('/stats/');
} catch (e) {
if (/no View with/.test(e.message)) {
console.error('Create the named View or fix route.viewName');
} else throw e;
} Prevention
- 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
When it happens
Trigger: A route definition like `{ path: '/stats/', viewName: 'stats' }` while `app.views.stats` was never created or was created under a different name.
Common situations: 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.
Related errors
- Framework7: wrong or not complete browserHistory configurati
- Framework7: TextEditor: wrong "buttons" parameter format
- Framework7: can't create a View instance because ${typeof el
- Framework7: it is not allowed to use router methods on globa
- Framework7: "name" or "path" parameter is required
AI-assisted analysis of framework7io/framework7@6557591266 (2026-09-02).
Data as JSON: /api/errors/f54ac8c1c28cc9f8.
Report an issue: GitHub.