This repository was archived by the owner on Dec 26, 2025. It is now read-only.
Description Describe the bug
After upgrading to .NET 10, sometimes we get the following error:
Error: System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Microsoft.JSInterop.Implementation.JSObjectReference'.
at :44366/Microsoft.JSInterop.Implementation.JSObjectReference.InvokeAsync[TValue](String identifier, Object[] args)
at :44366/Microsoft.JSInterop.JSObjectReferenceExtensions.InvokeVoidAsync(IJSObjectReference jsObjectReference, String identifier, Object[] args)
at :44366/Blazored.Modal.BlazoredModal.ClearBodyStyles()
at :44366/Blazored.Modal.BlazoredModal.CancelModals(Object sender, LocationChangedEventArgs e)
at :44366/System.Threading.Tasks.Task.<>c.<ThrowAsync>b__124_0(Object state)
at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.PostAsync[TState](:44366/Task antecedent, Action`1 callback, TState state)
To Reproduce
Steps to reproduce the behavior:
Create new Blazor Interactive Server application
Add Blazored modal
Create a few pages and inject the service
Launch the application and navigate between the pages
Expected behavior
No crash should be happening
Screenshots
Hosting Model (is this issue happening with a certain hosting model?):
Additional context
Add any other context about the problem here.
Reactions are currently unavailable