Is there an existing issue for this?
Describe the bug
What Happened
In the Blazor WebAssembly standalone and Interactive WebAssembly sample, clicking Run in Worker starts a 5-second worker operation. If you navigate from Counter to Weather before the operation finishes and then return to Counter, an error may appear in the browser console. This issue occurs randomly and is not consistently reproducible.
Expected Behavior
When navigating away, the WebWorkerClient should be disposed or cancelled safely. Any running worker operation should complete, cancel, or fail gracefully without causing unhandled browser or Blazor errors. Returning to the Counter page should create a clean component instance.
Steps To Reproduce
- Install .NET SDK
11.0.100-preview.7.26381.103
- Clone the sample repository:
https://github.com/Vinoth2562000/BlazorWebWorkerValidation/tree/main/Standalone_WebAssembly_NET11
- Open a terminal and navigate to the BlazorWebWorkerStandalone project folder.
- Install the
dotnet-serve tool (if it is not already installed):
dotnet tool install --global dotnet-serve
- Publish the application:
dotnet publish -c Release
- Navigate to the publish output directory:
cd bin\Release\net11.0\publish\wwwroot
- Host the published application:
- Open the localhost URL displayed in the terminal.
- Open the Counter page.
- Click Run in Worker.
- Before the 5-second operation completes, navigate to the Weather page.
- Navigate back to the Counter page.
- Click anywhere on the page and wait for the original worker operation to complete.
- Open Browser DevTools → Console and check for unhandled errors.
- Repeat the steps multiple times, as the issue occurs intermittently.
Evidence
Error Logs
Published Files
Screenshot
Observed Behavior
Disposing the WebWorkerClient and navigating away while a worker operation is still running can sometimes result in an unhandled browser console error.
Exceptions (if any)
No response
.NET Version
.NET SDK 11.0.100-preview.7.26381.103
Anything else?
No response
Is there an existing issue for this?
Describe the bug
What Happened
In the Blazor WebAssembly standalone and Interactive WebAssembly sample, clicking Run in Worker starts a 5-second worker operation. If you navigate from Counter to Weather before the operation finishes and then return to Counter, an error may appear in the browser console. This issue occurs randomly and is not consistently reproducible.
Expected Behavior
When navigating away, the WebWorkerClient should be disposed or cancelled safely. Any running worker operation should complete, cancel, or fail gracefully without causing unhandled browser or Blazor errors. Returning to the Counter page should create a clean component instance.
Steps To Reproduce
11.0.100-preview.7.26381.103https://github.com/Vinoth2562000/BlazorWebWorkerValidation/tree/main/Standalone_WebAssembly_NET11
dotnet-servetool (if it is not already installed):Evidence
Error Logs
Published Files
Screenshot
Observed Behavior
Disposing the
WebWorkerClientand navigating away while a worker operation is still running can sometimes result in an unhandled browser console error.Exceptions (if any)
No response
.NET Version
.NET SDK 11.0.100-preview.7.26381.103
Anything else?
No response