{"record":{"id":"1f837eea11fd61ac","repo":"PrismLibrary/Prism","slug":"no-tab-found-with-the-name-tabname","errorCode":null,"errorMessage":"No Tab found with the Name: {tabName}","messagePattern":"No Tab found with the Name: (.+?)","errorType":"exception","errorClass":"NavigationException","httpStatus":null,"severity":"error","filePath":"src/Maui/Prism.Maui/Navigation/PageNavigationService.cs","lineNumber":400,"sourceCode":"                    ViewModelLocator.GetNavigationName(x) == tabName\n                    || (x is NavigationPage navPage && ViewModelLocator.GetNavigationName(navPage.RootPage) == tabName)\n                    || (tabRegistration is not null && x is NavigationPage np && IsPage(np.RootPage, tabRegistration, tabName))\n                    || (tabRegistration is not null && IsPage(x, tabRegistration, tabName)));\n            }\n            else if (parts.Length == 2)\n            {\n                var rootRegistration = Registry.Registrations.FirstOrDefault(x => x.Name == parts[0]);\n                var leafRegistration = Registry.Registrations.FirstOrDefault(x => x.Name == parts[1]);\n                selectedChild = tabbedPage.Children.FirstOrDefault(x =>\n                    x is NavigationPage navPage\n                    && (ViewModelLocator.GetNavigationName(navPage) == parts[0] || (rootRegistration is not null && IsPage(navPage, rootRegistration, parts[0])))\n                    && (ViewModelLocator.GetNavigationName(navPage.RootPage) == parts[1] || (leafRegistration is not null && IsPage(navPage.RootPage, leafRegistration, parts[1]))));\n            }\n            else\n                throw new NavigationException($\"Invalid Tab Name: {tabName}\");\n\n            if (selectedChild is null)\n                throw new NavigationException($\"No Tab found with the Name: {tabName}\");\n\n            var navigatedFromPage = _pageAccessor.Page;\n            if (!await MvvmHelpers.CanNavigateAsync(navigatedFromPage, parameters))\n                throw new NavigationException(NavigationException.IConfirmNavigationReturnedFalse, navigatedFromPage);\n\n            var navigatedToTarget = selectedChild is NavigationPage navPage ? navPage.CurrentPage : selectedChild;\n            if (uri is not null)\n            {\n                if (uri.IsAbsoluteUri)\n                {\n                    throw new NavigationException(\"Cannot process an absolute Navigation Uri when navigating within a specified Tab\");\n                }\n\n                var navigationSegments = UriParsingHelper.GetUriSegments(uri);\n                await ProcessNavigation(navigatedToTarget, navigationSegments, parameters, null, null);\n                tabbedPage.CurrentPage = selectedChild;\n            }\n            else","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/PrismLibrary/Prism/blob/358118cd640d9a22ff8cf21c8ad197fa038b7990/src/Maui/Prism.Maui/Navigation/PageNavigationService.cs#L382-L418","documentation":"After parsing tabName, SelectTabAsync searches the TabbedPage's children (matching navigation names and/or registered page names, including NavigationPage root/leaf matching). If no child matches, it throws NavigationException('No Tab found with the Name: {tabName}') — the requested tab does not exist on the current TabbedPage.","triggerScenarios":"Calling SelectTabAsync with a name that matches no child: typo, wrong casing, tab not registered via Route/View registration, target tab added dynamically after the call, or matching against a NavigationPage's root page name that differs.","commonSituations":"Renaming a tab's ViewModel/page without updating the SelectTabAsync string; tabs created conditionally at runtime; using the registration name when the runtime navigation name differs (ViewModelLocator.AutowireViewModel vs explicit registration).","solutions":["Verify the tabName exactly matches the child page's navigation name (ViewModelLocator.GetNavigationName) or its registered name.","Check existing tab names at runtime (tabbedPage.Children and their navigation names) before calling.","Fix Prism registrations so the tab pages are registered with the names used at call sites.","If tabs are dynamic, only call SelectTabAsync after the tab has been added."],"exampleFix":"// before\nawait _navigationService.SelectTabAsync(\"SettingsTab\");\n// after\nvar tabbed = _pageAccessor.Page.GetParentPage() as TabbedPage;\nvar exists = tabbed?.Children.Any(c => ViewModelLocator.GetNavigationName(c) == \"SettingsTab\"\n    || ViewModelLocator.GetNavigationName((c as NavigationPage)?.RootPage ?? c) == \"SettingsTab\");\nif (exists == true)\n    await _navigationService.SelectTabAsync(\"SettingsTab\");","handlingStrategy":"validation","validationCode":"var tabbed = currentPage.GetParentPage() as TabbedPage;\nbool tabExists = tabbed?.Children.Any(c =>\n    ViewModelLocator.GetNavigationName(c) == tabName\n    || ViewModelLocator.GetNavigationName((c as NavigationPage)?.RootPage ?? c) == tabName) == true;\nif (tabExists) await _navigationService.SelectTabAsync(tabName);","typeGuard":null,"tryCatchPattern":"try { await _navigationService.SelectTabAsync(tabName); }\ncatch (NavigationException ex) when (ex.Message.StartsWith(\"No Tab found\"))\n{ /* log the registered tab names and correct the name */ }","preventionTips":["Derive tab names from shared constants matching page registrations","Dump tabbedPage.Children navigation names when debugging mismatches","Re-check names after renaming ViewModels/pages or changing AutowireViewModel settings"],"tags":["navigation","tabbedpage","not-found","prism","xamarin-maui"],"backgroundTag":"resource-not-found","analyzedSha":"358118cd640d9a22ff8cf21c8ad197fa038b7990","analyzedAt":"2026-09-15T15:00:31.079Z","contentChangedAt":"2026-09-15T15:00:31.079Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}