You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
An exception is thrown during the Dispose handler of the IntersectionObserve component when the circuit itself is being disposed.
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
Microsoft.JSInterop.JSDisconnectedException: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSRuntime.BeginInvokeJS(Int64 asyncHandle, String identifier, String argsJson, JSCallResultType resultType, Int64 targetInstanceId)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, CancellationToken cancellationToken, Object[] args)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at Ljbc1994.Blazor.IntersectionObserver.IntersectionObserverService.RemoveObserver(String id)
at Ljbc1994.Blazor.IntersectionObserver.IntersectionObserver.Dispose()
at Ljbc1994.Blazor.IntersectionObserver.Components.IntersectionObserve.DisposeAsync()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.<>c__DisplayClass69_0.<<Dispose>g__HandleAsyncExceptions|1>d.MoveNext()
Everything still works fine after the exception, but it fills up the error log with unnecessary error messages.
To Reproduce
Create a page that contains the IntersectionObserve component
Refresh or close the page
An exception will be logged to the error logs
Expected behavior
Catch and silently ignore the exception since we don't need to dispose of the observer if the browser is being closed anyway.
System Info
Blazor Server
.NET 6
Additional context
This was caused by a changed to Blazor that prevents JS Interop actions during circuit disposal: dotnet/aspnetcore#32901
The text was updated successfully, but these errors were encountered:
@ljbc1994
Any chance, that a fix for this will come?
We have the same problem and the only thing we can currently do, is suppressing the log by ugly Exception filtering.
Describe the bug
An exception is thrown during the Dispose handler of the IntersectionObserve component when the circuit itself is being disposed.
Everything still works fine after the exception, but it fills up the error log with unnecessary error messages.
To Reproduce
Expected behavior
Catch and silently ignore the exception since we don't need to dispose of the observer if the browser is being closed anyway.
System Info
Additional context
This was caused by a changed to Blazor that prevents JS Interop actions during circuit disposal: dotnet/aspnetcore#32901
The text was updated successfully, but these errors were encountered: