PrismLibrary/Prism · error · NavigationException

No Tab found with the Name

Error message

No Tab found with the Name: {tabName}

What it means

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.

Solutions

  1. Verify the tabName exactly matches the child page's navigation name (ViewModelLocator.GetNavigationName) or its registered name.
  2. Check existing tab names at runtime (tabbedPage.Children and their navigation names) before calling.
  3. Fix Prism registrations so the tab pages are registered with the names used at call sites.
  4. If tabs are dynamic, only call SelectTabAsync after the tab has been added.

Example fix

// before
await _navigationService.SelectTabAsync("SettingsTab");
// after
var tabbed = _pageAccessor.Page.GetParentPage() as TabbedPage;
var exists = tabbed?.Children.Any(c => ViewModelLocator.GetNavigationName(c) == "SettingsTab"
    || ViewModelLocator.GetNavigationName((c as NavigationPage)?.RootPage ?? c) == "SettingsTab");
if (exists == true)
    await _navigationService.SelectTabAsync("SettingsTab");
Defensive patterns

Strategy: validation

Validate before calling

var tabbed = currentPage.GetParentPage() as TabbedPage;
bool tabExists = tabbed?.Children.Any(c =>
    ViewModelLocator.GetNavigationName(c) == tabName
    || ViewModelLocator.GetNavigationName((c as NavigationPage)?.RootPage ?? c) == tabName) == true;
if (tabExists) await _navigationService.SelectTabAsync(tabName);

Try / catch

try { await _navigationService.SelectTabAsync(tabName); }
catch (NavigationException ex) when (ex.Message.StartsWith("No Tab found"))
{ /* log the registered tab names and correct the name */ }

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of PrismLibrary/Prism@358118cd64 (2026-09-15). Data as JSON: /api/errors/1f837eea11fd61ac. Report an issue: GitHub.

Appendix: source

Thrown at src/Maui/Prism.Maui/Navigation/PageNavigationService.cs:400

                    ViewModelLocator.GetNavigationName(x) == tabName
                    || (x is NavigationPage navPage && ViewModelLocator.GetNavigationName(navPage.RootPage) == tabName)
                    || (tabRegistration is not null && x is NavigationPage np && IsPage(np.RootPage, tabRegistration, tabName))
                    || (tabRegistration is not null && IsPage(x, tabRegistration, tabName)));
            }
            else if (parts.Length == 2)
            {
                var rootRegistration = Registry.Registrations.FirstOrDefault(x => x.Name == parts[0]);
                var leafRegistration = Registry.Registrations.FirstOrDefault(x => x.Name == parts[1]);
                selectedChild = tabbedPage.Children.FirstOrDefault(x =>
                    x is NavigationPage navPage
                    && (ViewModelLocator.GetNavigationName(navPage) == parts[0] || (rootRegistration is not null && IsPage(navPage, rootRegistration, parts[0])))
                    && (ViewModelLocator.GetNavigationName(navPage.RootPage) == parts[1] || (leafRegistration is not null && IsPage(navPage.RootPage, leafRegistration, parts[1]))));
            }
            else
                throw new NavigationException($"Invalid Tab Name: {tabName}");

            if (selectedChild is null)
                throw new NavigationException($"No Tab found with the Name: {tabName}");

            var navigatedFromPage = _pageAccessor.Page;
            if (!await MvvmHelpers.CanNavigateAsync(navigatedFromPage, parameters))
                throw new NavigationException(NavigationException.IConfirmNavigationReturnedFalse, navigatedFromPage);

            var navigatedToTarget = selectedChild is NavigationPage navPage ? navPage.CurrentPage : selectedChild;
            if (uri is not null)
            {
                if (uri.IsAbsoluteUri)
                {
                    throw new NavigationException("Cannot process an absolute Navigation Uri when navigating within a specified Tab");
                }

                var navigationSegments = UriParsingHelper.GetUriSegments(uri);
                await ProcessNavigation(navigatedToTarget, navigationSegments, parameters, null, null);
                tabbedPage.CurrentPage = selectedChild;
            }
            else

View on GitHub (pinned to 358118cd64)