Skip to content

Blazor Server page crashing after reconnect with multiple clients #53730

Closed
@heckradr

Description

@heckradr

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I created a component that is able to reload the whole page when blazor server gets disconnected (for example after a server restart). In this case the automatic reconnect mechanism does not work and normally the user has to reload the page manually.

The control is able to detect this case and will perform a reload of the page with a JS call.

With only 1 connected client (browser window) this works perfectly. If I start multiple clients / browser windows sometimes the page crashes with the typical blazor error bar.

Error output

The following error is logged in the console:

Error: The list of component operations is not valid.

image

Expected Behavior

The page should be reloaded on all clients, without any error message (no matter how many clients are connected at the same time).

Steps To Reproduce

I created a demo project here: https://github.com/heckradr/BlazorReconnectTest

  • compile and start the project
  • point at least two browsers to the url http://localhost:5006
  • when the page is loaded on all clients -> re-start the debugger
  • you will notice the ReconnectModal: First it will try to restore the connection but this fails (Connection failed, Reconnecting...). Then after a sleep time of 5 seconds the javascript call will reload the whole page.
  • when the error occurs, one of the 2 pages will stop working with the typical blazor error bar
  • the error does not occur on every attempt, maybe you have to repeat the steps

Exceptions (if any)

No response

.NET Version

8.0.100 / 8.0.200-preview.23624.5

Anything else?

The problem occurs on a system with .NET 8.0.100 and also with .NET 8.0.200-preview.23624.5.

Here is the output of "dotnet --info":

.NET SDK:
Version: 8.0.200-preview.23624.5
Commit: 8065b9770c
Workload version: 8.0.200-manifests.66f5ce51

Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.200-preview.23624.5\

Installierte .NET-Workloads:
Workload version: 8.0.200-manifests.66f5ce51
Es sind keine installierten Workloads zum Anzeigen vorhanden.

Host:
Version: 8.0.0
Architecture: x64
Commit: 5535e31a71

.NET SDKs installed:
8.0.200-preview.23624.5 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not foud

Metadata

Metadata

Assignees

Labels

Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.area-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.feature-blazor-server

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions