Skip to content

InvalidOperationException: Cannot find the fallback endpoint specified by route values: { page: /, area: }. #62618

Open
@etriebe

Description

@etriebe

I have a Blazor WASM client project and a Blazor Server project for APIs/login pages. I'm attempting to add deep linking and page reload support. I added the following line to my Server project Program.cs

app.MapFallbackToPage("/");

I have a page in my Wasm client project with the Page route

@page "/"

But when I launch the project with this, any page will fail with the following exception.

System.InvalidOperationException: Cannot find the fallback endpoint specified by route values: { page: /, area:  }.
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.DynamicPageEndpointMatcherPolicy.ApplyAsync(HttpContext httpContext, CandidateSet candidates)
   at Microsoft.AspNetCore.Routing.Matching.DfaMatcher.SelectEndpointWithPoliciesAsync(HttpContext httpContext, IEndpointSelectorPolicy[] policies, CandidateSet candidateSet)
   at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.<Invoke>g__AwaitMatch|10_1(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task matchTask)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Without this line, everything will load fine, the site will work but if you refresh any page that isn't the homepage, it will fail for a variety of reasons.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.Needs: ReproIndicates that the team needs a repro project to continue the investigation on this issuearea-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions