Skip to content
This repository was archived by the owner on Dec 26, 2025. It is now read-only.
This repository was archived by the owner on Dec 26, 2025. It is now read-only.

[Bug] ObjectDisposedException while navigating between Interactive to StreamRendering mode in Blazor Web App #594

@theumairtahir

Description

@theumairtahir

Describe the bug
It throws an unhandled ObjectDisposedException while navigating between Interactive to StreamRendering mode in Blazor Web App, because of the exception the application gets into an error state. The stack trace is below:
System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Microsoft.JSInterop.WebAssembly.WebAssemblyJSObjectReference'. at Microsoft.JSInterop.Implementation.JSObjectReference.ThrowIfDisposed() at Microsoft.JSInterop.Implementation.JSObjectReference.InvokeAsync[IJSVoidResult](String identifier, Object[] args) at Microsoft.JSInterop.JSObjectReferenceExtensions.InvokeVoidAsync(IJSObjectReference jsObjectReference, String identifier, Object[] args) at Blazored.Modal.BlazoredModal.ClearBodyStyles() at Blazored.Modal.BlazoredModal.CancelModals(Object sender, LocationChangedEventArgs e) at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state) at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.ThreadPool.BackgroundJobHandler()

To Reproduce
Steps to reproduce the behavior:

  1. Navigate to a page with rendermode = InteractiveWebAssembly
  2. Navigate back to a page with rendermode = StreamRendering
  3. Try to Navigate to some other page
  4. The application will be in error state then

Expected behavior
A clear and concise description of what you expected to happen.

Hosting Model (is this issue happening with a certain hosting model?):

  • Blazor Web App (Blazor United)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingTriageIssue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions