Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
theumairtahir opened this issue Jan 27, 2025 · 0 comments
Labels
Bug Something isn't working Triage Issue needs to be triaged

Comments

@theumairtahir
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant