Blazor.NET: What causes "A task was canceled" within JavaScript

There's a default maximum to the size of an incoming hub message. The first time I encountered this issue I tried to change the ApplicationMaxBufferSize and TransportMaxBufferSize of the blazor hub but it didn't solve the issue.

Instead add the SignalR service and set the MaximumReceiveMessageSize.

        services.AddSignalR(e => {
            e.MaximumReceiveMessageSize = 1000;
        });

https://docs.microsoft.com/en-gb/aspnet/core/signalr/configuration?view=aspnetcore-3.0&tabs=dotnet#configure-server-options

Hope this helps.

Tags:

Blazor