Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(BlazorServer) each navigation to external logs 2 errors a minute later #45267

Closed
1 task done
springy76 opened this issue Nov 24, 2022 · 26 comments
Closed
1 task done
Assignees
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-blazor-server feature-blazor-server-auth Pillar: Technical Debt Priority:1 Work that is critical for the release, but we could probably ship without
Projects
Milestone

Comments

@springy76
Copy link

springy76 commented Nov 24, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Each time you leave the blazor circuit a minute later two exceptions are logged.

Expected Behavior

zero errors in log when no one does wrong things.

Steps To Reproduce

Run original sample created by dotnet.exe new blazorserver --name BlazorServerTemplate --output . -f net7.0 --auth Individual --use-program-main

On top right click on "Login" which is <a href="Identity/Account/Login">Log in</a> in LoginDisplay.razor.

Wait a minute (or maybe 2) then 2 errors are logged to console (or external logging apps like SEQ):

fail: Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager[4]
      Navigation failed when changing the location to https://localhost:7206/Identity/Account/Login?returnUrl=~/counter
      System.Threading.Tasks.TaskCanceledException: A task was canceled.
         at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
         at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
         at Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.<>c__DisplayClass13_0.<<NavigateToCore>g__PerformNavigationAsync|0>d.MoveNext()
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
      Unhandled exception in circuit 'XaCjYqsnL_QC9xVVeKm9IEojYbj1uBcoSgjuyHwtR7U'.
      System.Threading.Tasks.TaskCanceledException: A task was canceled.
         at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
         at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
         at Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.<>c__DisplayClass13_0.<<NavigateToCore>g__PerformNavigationAsync|0>d.MoveNext()

Exceptions (if any)

TaskCancelledException

.NET Version

7.0.0

@mkArtakMSFT mkArtakMSFT added the bug This issue describes a behavior which is not expected - a bug. label Nov 28, 2022
@mkArtakMSFT mkArtakMSFT added this to the .NET 8 Planning milestone Nov 28, 2022
@ghost
Copy link

ghost commented Nov 28, 2022

Thanks for contacting us.

We're moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@springy76
Copy link
Author

Having rolled out our software with update net6->net7 our SEQ counter for (important) circuit crashes now increased from 20-40 per day to 1600-2000 per day.

One more callstack seems to be new, too:

Microsoft.JSInterop.JSDisconnectedException: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
   at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSRuntime.BeginInvokeJS(Int64 asyncHandle, String identifier, String argsJson, JSCallResultType resultType, Int64 targetInstanceId)
   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, CancellationToken cancellationToken, Object[] args)
   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
   at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
   at Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.<>c__DisplayClass13_0.<<NavigateToCore>g__PerformNavigationAsync|0>d.MoveNext()

@bainn
Copy link

bainn commented Dec 7, 2022

I am having the same issue, everything was working just fine. After shut down and restart then it started. Microsoft Edge will not even display anything and the error message comes to the console. Firefox displays the home but when you click the Login button then after a minute or so the error will show in console. Below is the error.

info: Microsoft.Hosting.Lifetime[14]
Now listening on: https://localhost:7190
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5284
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\Home\AppDevelopment\CLR\macOS\BMCL.LawReport.Web\BMCL.LawReport.Web
fail: Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager[4]
Navigation failed when changing the location to https://localhost:7190/Identity/Account/Register
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
at Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.<>c__DisplayClass13_0.<g__PerformNavigationAsync|0>d.MoveNext()
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit '_A1lxTjBg9kuqSn-C42i1_2xnofAJ1BiPvN5nb2eENo'.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
at Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.<>c__DisplayClass13_0.<g__PerformNavigationAsync|0>d.MoveNext()

@bainn
Copy link

bainn commented Dec 7, 2022

Observations: Microsoft Edge is not able to display the home page at all. Firefox is able to display the home page, you are able to click login and fill in the form but when you click the blue login button, a few minutes later it logs the above errors.
Google Chrome, Brave, Opera and Vivaldi behave like Firefox but they do not log the error to the console.

Visual Studio Community edition version 17.4.2
Windows 11 Pro 22H2 Build 22621.900

I did windows update yesterday. That is the only thing I did that from then on it started given the error above. I hope the updated information helps.

@mtbayley
Copy link

mtbayley commented Dec 9, 2022

Also running into a simalar exception with MircosoftIdentity

Message: Navigation failed when changing the location to https://..../MicrosoftIdentity/Account/SignOut
Callsite: Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.NavigateToCore
Exception: System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
   at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
   at Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.<>c__DisplayClass13_0.<<NavigateToCore>g__PerformNavigationAsync|0>d.MoveNext()

@bainn
Copy link

bainn commented Dec 13, 2022

Upon further investigation, I realized it was coming from the OnPostAsync method. I found out that Microsoft SQL server had stopped after windows update. Restarting SQL server in the services applet stopped the error and everything was okay. If in your appsettings.json file you use IP Address and you move to another subnet, you may experience similar frustration. Correction to the new IP Address will resolve the issue.

But strangely when I put the whole code block in a try catch nothing happened. It couldn't move past the following code which is the problematic code when SQL Server is offline and you don't know it's offline:

var result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: false);
Now, my question is: How do you report to your user if something has gone wrong and send a graceful message like "No internet connection or Database is down?" Below is the code in a try/catch:

` public async Task OnPostAsync(string returnUrl = null)
{
try
{
returnUrl ??= Url.Content("~/");

            ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();

            if (ModelState.IsValid)
            {
                // This doesn't count login failures towards account lockout
                // To enable password failures to trigger account lockout, set lockoutOnFailure: true
                var result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: false);
                if (result.Succeeded)
                {
                    _logger.LogInformation("User logged in.");
                    return LocalRedirect(returnUrl);
                }
                if (result.RequiresTwoFactor)
                {
                    return RedirectToPage("./LoginWith2fa", new { ReturnUrl = returnUrl, RememberMe = Input.RememberMe });
                }
                if (result.IsLockedOut)
                {
                    _logger.LogWarning("User account locked out.");
                    return RedirectToPage("./Lockout");
                }
                else
                {
                    ModelState.AddModelError(string.Empty, "Invalid login attempt.");
                    return Page();
                }
            }

            // If we got this far, something failed, redisplay form
            return Page();
        }
        catch (Exception ex)
        {
            ErrorMessage = ex.Message;
            return Page();
        }
    }

`

@Tim-Hodge
Copy link

@springy76 @mkArtakMSFT any updates or known workarounds for this one?

@Schtailian
Copy link

Schtailian commented Feb 13, 2023

i have the same issue. I check if the user is authenticated, if not i redirect to the login page.

My App.razor looks like this.

<CascadingAuthenticationState>
    <Router AppAssembly="@typeof(Program).Assembly">
        <Found Context="routeData">
            <AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
                <NotAuthorized>
                    @if (!IsAuthenticated())
                    {
                        <h1>Hi,</h1>
                        <p>You need to login</p>
                        <a href="login?redirectUri=@NavigationManager.Uri">Login now</a>
                    }
                    else
                    {
                        <h1>Hi,</h1>
                        <p>You have no access rights</p>
                        <p>Contact an administrator</p>
                    }
                </NotAuthorized>
                <Authorizing>
                    <p>Loading...</p>
                </Authorizing>
            </AuthorizeRouteView>
        </Found>
        <NotFound>
            <LayoutView Layout="@typeof(MainLayout)">
                <p>404 - Not Found</p>
            </LayoutView>
        </NotFound>
    </Router>
</CascadingAuthenticationState>

@code {
    private bool IsAuthenticated()
    {
        var authState = AuthenticationStateProvider.GetAuthenticationStateAsync().Result;
        var user = authState.User;

        if (user.Identity!.IsAuthenticated)
        {
            return true;
        }
        else
        {
            try {
                NavigationManager.NavigateTo($"login?redirectUri={NavigationManager.Uri}", true, true);
            }
            catch { }
            return false;
        }

    }
}

Error
Navigation failed when changing the location to login?redirectUri=https://domain.com/application/

System.Threading.Tasks.TaskCanceledException: A task was canceled.
  File "JSRuntime.cs", in async ValueTask<TValue> JSRuntime.InvokeAsync<TValue>(long targetInstanceId, string identifier, object[] args)
  File "JSRuntimeExtensions.cs", in async ValueTask JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, string identifier, params object[] args)
  File "RemoteNavigationManager.cs", in async void RemoteNavigationManager.NavigateToCore(string uri, NavigationOptions options)+PerformNavigationAsync(?)

It's a Blazor Server Application, .NET 7

@springy76
Copy link
Author

@Schtailian just a side note regarding your code snippet: Do not use the Result property of Tasks to "await" a task, all sorts of deadlocks might happen using such code. The NotAuthorized renderfragment already transports the awaited AuthenticationState by context variable, just pass it around:

                <NotAuthorized Content="authState">
                    @if (!IsAuthenticated(authState))

@Schtailian
Copy link

@springy76 thanks, that looks way better. Just for future readers, the awaited state is part of the <AuthorizeRouteView> not of <NotAuthorized>.

It should look like this:

<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" Context="authState">
    <NotAuthorized>
        @if (!IsAuthenticated(authState))

@springy76
Copy link
Author

@Schtailian now it looks wrong to me - to my knowledge Context at the component level only makes sense when using ChildContent implicitly (when of type RenderFragment<T>).

Just for future readers, the state part definitely is part of the NotAuthorized parameter, see https://github.com/dotnet/dotnet/blob/main/src/aspnetcore/src/Components/Authorization/src/AuthorizeRouteView.cs#L52

@Schtailian
Copy link

@springy76 Sorry, yea you totally write. I was to impatient with intellisense 🙉
it's like in your example but with context instead of content.

<NotAuthorized Context="authState">
    @if (!IsAuthenticated(authState))

@Schtailian
Copy link

Hi,
since i changed my IsAuthenticated the way @springy76 suggested i get no more Navigation failed when changing the location to... errors.

Having rolled out our software with update net6->net7 our SEQ counter for (important) circuit crashes now increased from 20-40 per day to 1600-2000 per day.

One more callstack seems to be new, too:

Microsoft.JSInterop.JSDisconnectedException: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
   at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSRuntime.BeginInvokeJS(Int64 asyncHandle, String identifier, String argsJson, JSCallResultType resultType, Int64 targetInstanceId)
   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, CancellationToken cancellationToken, Object[] args)
   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
   at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
   at Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.<>c__DisplayClass13_0.<<NavigateToCore>g__PerformNavigationAsync|0>d.MoveNext()

I still get these. I think they might happen with this component https://github.com/Blazored/Toast, but i haven't tried so far. @springy76 do you use anything similar?

@ghost
Copy link

ghost commented Oct 6, 2023

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@HoofedEar
Copy link

HoofedEar commented Oct 6, 2023

Leaving this comment here for a fix that worked for me.
I kept getting the above NavigationManager exceptions when trying to interact with my custom Authentication middleware that handles my login/logout requests. This was what I was previously using to trigger a login (inside of my Blazor page, in the code section):

NavManager.NavigateTo(returnUrl != null ? $"/middleware-login?key={key}&returnUrl={returnUrl}" : $"/middleware-login?key={key}", true, true);

After replacing it with this:

@inject IJSRuntime JSRuntime
...
await JSRuntime.InvokeVoidAsync("window.location.assign", returnUrl != null ? $"/middleware-login?key={key}&returnUrl={returnUrl}" : $"/middleware-login?key={key}");

I stopped getting those exceptions from NavigationManager. Hope this is helpful to others!

EDIT: Also, I noticed that the aforementioned exceptions appear if you try to navigate to a page that doesn't exist.

@springy76
Copy link
Author

I still get these. I think they might happen with this component https://github.com/Blazored/Toast, but i haven't tried so far. @springy76 do you use anything similar?

@Schtailian no, it's just the unchanged template created by dotnet.exe new blazorserver --name BlazorServerTemplate --output . -f net7.0 --auth Individual --use-program-main

and still the same with net8 + Blazor WebApp + Individual Auth .. multiple errors in console after just some simple clicks

@Schtailian
Copy link

I still get these. I think they might happen with this component https://github.com/Blazored/Toast, but i haven't tried so far. @springy76 do you use anything similar?

@Schtailian no, it's just the unchanged template created by dotnet.exe new blazorserver --name BlazorServerTemplate --output . -f net7.0 --auth Individual --use-program-main

and still the same with net8 + Blazor WebApp + Individual Auth .. multiple errors in console after just some simple clicks

yep, still the same with .net 8 also for me. @mkArtakMSFT is there anything we can do, to prevent this?

@mkArtakMSFT mkArtakMSFT removed this from the Planning: WebUI milestone Dec 12, 2023
@mkArtakMSFT mkArtakMSFT added this to the .NET 9 Planning milestone Dec 12, 2023
@ghost
Copy link

ghost commented Dec 12, 2023

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@mkArtakMSFT mkArtakMSFT added the Priority:1 Work that is critical for the release, but we could probably ship without label Jan 9, 2024
@mkArtakMSFT mkArtakMSFT modified the milestones: .NET 9 Planning, 7.0.x, 8.0.x Jan 9, 2024
@mkArtakMSFT mkArtakMSFT added this to 8.0.x in Servicing Jan 9, 2024
@pkejval
Copy link

pkejval commented Jan 10, 2024

@HoofedEar Thanks, your solution with JSRuntime works! :)

For issuetracker: I noticed that this bug happens only in Firefox browser. No errors with Chromium based browsers.

mkArtakMSFT pushed a commit that referenced this issue Jan 16, 2024
…nute later (#53297)

Backport of #53271 to release/8.0

/cc @javiercn

# [Blazor] each navigation to external logs 2 errors a minute later

Capture an exception and log a message when navigation fails because the session has ended.

## Description

- The user clicks the link to the target URL.
- That link is intercepted in the JavaScript.
- .NET is called to determine if navigation to the URL needs to be prevented.
- It is determined that there is no need to prevent navigation and "navigateTo" is called via JS interop in NavigationManager.ts.
- The URL is determined to be external by "navigateTo" and the location is set to the new URL.
- The unload event in the browser is automatically triggered, which in turn triggers the call to _disconnect.
- As a result, the promise to "navigateTo" never completes (the page gets unloaded before that) and the associated task in .NET ends up getting cancelled with a timeout.

Fixes #45267

## Customer Impact

Customers see a large number of errors in their logs when their sites contain links to external sites, which in turn can trigger alerts in their incident monitoring systems.

## Regression?

- [ ] Yes
- [X] No

## Risk

- [ ] High
- [ ] Medium
- [X] Low

The scenario in which the issue happens is well defined and the fix is simple.

## Verification

- [X] Manual (required)
- [ ] Automated

![image](https://github.com/dotnet/aspnetcore/assets/6995051/a61a9898-771a-414c-a83c-7836bf88697c)

## Packaging changes reviewed?

- [ ] Yes
- [ ] No
- [X] N/A

----

## When servicing release/2.1

- [ ] Make necessary changes in eng/PatchConfig.props

---------

Co-authored-by: jacalvar <jacalvar@microsoft.com>
@mkArtakMSFT mkArtakMSFT modified the milestones: 8.0.x, 8.0.2 Jan 16, 2024
Servicing automation moved this from 8.0.x to Done Jan 16, 2024
@Apflkuacha
Copy link

Why is this issue closed? I updated to .NET 8.0.3 and still these Exceptions occure

@Schtailian
Copy link

also still occurs for me.

@neozhu
Copy link

neozhu commented Apr 3, 2024

also still occurs for me.
https://architecture.blazorserver.com/

Message

Navigation failed when changing the location to "/pages/authentication/login"

Exception

System.Threading.Tasks.TaskCanceledException: A task was canceled. at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args) at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args) at Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.<>c__DisplayClass13_0.<g__PerformNavigationAsync|0>d.MoveNext()

@HuaFangYun
Copy link

.Net 8.0.202 After the Token expires, perform a jump to report an error
fail: Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager[4]
Navigation failed when changing the location to /account/login
Microsoft.JSInterop.JSDisconnectedException: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSRuntime.BeginInvokeJS(Int64 asyncHandle, String identifier, String argsJson, JSCallResultType resultType, Int64 targetInstanceId)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, CancellationToken cancellationToken, Object[] args)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
at Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.<>c__DisplayClass13_0.<g__PerformNavigationAsync|0>d.MoveNext()
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit 'kmkVQI7CkMhk5PF5hg8stSuK9CyAb2hFgDonmgcTCuw'.
Microsoft.JSInterop.JSDisconnectedException: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSRuntime.BeginInvokeJS(Int64 asyncHandle, String identifier, String argsJson, JSCallResultType resultType, Int64 targetInstanceId)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, CancellationToken cancellationToken, Object[] args)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
at Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.<>c__DisplayClass13_0.<g__PerformNavigationAsync|0>d.MoveNext()
info: System.Net.Http.HttpClient.webapi.LogicalHandler[100]

@InLoad-Mikkel
Copy link

It still occurs for us as well, albeit at a significantly reduced rate. Could you take another look @mkArtakMSFT ?

Thanks =)

@ThatMouse
Copy link

ThatMouse commented Apr 15, 2024

I am also dealing with this, and have come to find this is a known issue? I'm not sure I'm a fan of the Js workaround...
<NavLink href="MicrosoftIdentity/Account/SignIn">Sign In</NavLink>

04/15/2024 14:11:42 Navigation failed when changing the location to "https://localhost:xxxx/MicrosoftIdentity/Account/SignIn"
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
at Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.<>c__DisplayClass13_0.<g__PerformNavigationAsync|0>d.MoveNext()

04/15/2024 14:11:42 Unhandled exception in circuit '"xxxxxxxxx"'.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
at Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.<>c__DisplayClass13_0.<g__PerformNavigationAsync|0>d.MoveNext()

@joeballard
Copy link

Still occurs for me also. What's odd is that I seem to only get this when on iOS & iPadOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-blazor-server feature-blazor-server-auth Pillar: Technical Debt Priority:1 Work that is critical for the release, but we could probably ship without
Projects
Development

No branches or pull requests

16 participants