{"record":{"id":"22dfa3c4eb8b6075","repo":"PrismLibrary/Prism","slug":"cannot-process-an-absolute-navigation-uri-when-navigating","errorCode":null,"errorMessage":"Cannot process an absolute Navigation Uri when navigating within a specified Tab","messagePattern":"Cannot process an absolute Navigation Uri when navigating within a specified Tab","errorType":"exception","errorClass":"NavigationException","httpStatus":null,"severity":"error","filePath":"src/Maui/Prism.Maui/Navigation/PageNavigationService.cs","lineNumber":411,"sourceCode":"                    && (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\n            {\n                tabbedPage.CurrentPage = selectedChild;\n                parameters.GetNavigationParametersInternal().Add(KnownInternalParameters.NavigationMode, NavigationMode.New);\n                MvvmHelpers.OnNavigatedFrom(navigatedFromPage, parameters);\n                MvvmHelpers.OnNavigatedTo(navigatedToTarget, parameters);\n            }\n\n            return new NavigationResult();\n        }\n        catch (Exception ex)\n        {","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/PrismLibrary/Prism/blob/358118cd640d9a22ff8cf21c8ad197fa038b7990/src/Maui/Prism.Maui/Navigation/PageNavigationService.cs#L393-L429","documentation":"Prism's PageNavigationService throws this when you ask SelectTabAsync to navigate using an absolute URI (e.g. ':///MyPage' or 'https://app/MyPage') while targeting a tab of an existing TabbedPage. Tab-level navigation only supports relative segments because it operates on an already-resolved child page inside the tab, not the root navigation stack.","triggerScenarios":"Calling navigationService.SelectTabAsync(uri, tabbedPage, selectedTab, parameters) (directly or via a tab-select URI segment) with a uri whose IsAbsoluteUri is true.","commonSituations":"Passing a full deep-link URI into a tab-selection flow; concatenating an app scheme root onto a tab path; reusing a deep-link handler that always builds absolute URIs when the user taps a tab.","solutions":["Use a relative URI or page name for tab navigation, e.g. 'ViewA?id=5' instead of 'app://.../ViewA?id=5'","Strip the scheme/host from your deep link before passing it to tab navigation: new Uri(link).PathAndQuery trimmed of leading '/'","Handle absolute deep links at the app root (NavigateAsync) and reserve tab selection for relative segments"],"exampleFix":"// before\nawait _navigationService.SelectTabAsync(new Uri(\"app:///ViewB\"), tabbedPage, \"ViewB\");\n// after\nawait _navigationService.SelectTabAsync(\"ViewB\", tabbedPage, \"ViewB\");","handlingStrategy":"validation","validationCode":"if (uri is not null && uri.IsAbsoluteUri)\n    throw new ArgumentException(\"Use a relative URI for tab navigation\");","typeGuard":"static bool IsRelativeNavUri(Uri? uri) => uri is null || !uri.IsAbsoluteUri;","tryCatchPattern":null,"preventionTips":["Reserve absolute URIs for root deep links, relative segments for tab/stack navigation","Centralize URI construction in one helper that enforces relative form for tabs","Add unit tests for tab navigation URI shapes"],"tags":["prism","maui","navigation","uri"],"backgroundTag":"invalid-url-format","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"}