I have a Blazor server app and every couple of minutes I get the following in my logs:
Error 12:09:54 [] Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager - Navigation failed when changing the location to https://louishowe-dev.azurewebsites.net/Identity/Account/Login 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()
Error 12:09:54 [] Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost - Unhandled exception in circuit 'GdWjUPhwt9bdljJjyKo0M-eVaVKtacUkhqCtNuwOg-s'. 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()
The program continues to run fine and the user sees no issue. But exceptions are generally bad news. What's going on here and how do I avoid this?
From Microsoft support:
Blazor.NET: What causes "A task was canceled" within JavaScript - Stack Overflow
Trouble with NavigateTo within OnInitialized · Issue #13582 · dotnet/aspnetcore · GitHub