JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
See original GitHub issueIn a Blazor Server app, starting with version 3.1.0, we are seeing the exception below in our logs. It seems to occur when a user navigates from a page that includes a map. Is there something that needs done in the component to properly dispose?
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 GoogleMapsComponents.Helper.MyInvokeAsync[TRes](IJSRuntime jsRuntime, String identifier, Object[] args)
at GoogleMapsComponents.JsObjectRef.InvokeAsync(String functionName, Object[] args)
at GoogleMapsComponents.Maps.MapEventListener.RemoveAsync()
at GoogleMapsComponents.Maps.MapEventListener.DisposeAsyncCore()
at GoogleMapsComponents.Maps.MapEventListener.DisposeAsync()
at GoogleMapsComponents.Maps.Extension.EventEntityBase.DisposeAsyncCore()
at GoogleMapsComponents.Maps.Map.DisposeAsyncCore()
at GoogleMapsComponents.Maps.Map.DisposeAsync()
at GoogleMapsComponents.MapComponent.DisposeAsyncCore()
at GoogleMapsComponents.MapComponent.DisposeAsync()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.<>c__DisplayClass74_0.<<Dispose>g__HandleAsyncExceptions|1>d.MoveNext()
Issue Analytics
- State:
- Created 2 months ago
- Comments:5
Top Results From Across the Web
JavaScript interop calls cannot be issued at this time. .. ...
JavaScript (JS) interop calls can't be issued after a SignalR circuit is disconnected. Without a circuit during component disposal or at any ...
Read more >JavaScript interop calls cannot be issued at this time. ...
JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed #48220.
Read more >Identifying what is causing interop errors : r/Blazor
JSInterop.JSDisconnectedException: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is ...
Read more >JavaScript interop calls cannot be issued at this time when ...
I work on blazor web app with .net core 7 . I get error when try to pass user name from login page...
Read more >NET 6 RC1 Telerik Blazor
JSInterop.JSDisconnectedException: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think it is reasonable enough to do so. Since:
The downsides I can think of are:
I have never released a resuable component to Nuget - so take the following with a grain of salt: I think that as a reusable component auther you should target the lowest version that is “modern” and feature rich enogh for you. This will allow your users to use this component, without constraining them to a new version that they might not have migrated to yet. I think in your case this would be .net5.0, possiblly .net6.0.
Also, take a look this section in the linked article. It is very relevnt to this topic.
Was able to reproduce. Fixed in this PR