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

Stacked Bar Chart - chart.React() - Cannot access a disposed object.\r\nObject name: 'DotNetObjectReference #185

Open
CliffBDev opened this issue Jun 10, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@CliffBDev
Copy link

CliffBDev commented Jun 10, 2022

I am trying to update a stacked bar chart that is being used in a dashboard every 5 minutes or so and also has the capability of being able to be manually refreshed whenever the user wants to. When calling chart.React() this is the error I am getting.
Cannot access a disposed object.
Object name: 'DotNetObjectReference`1'.

With a stack trace of:
at Microsoft.JSInterop.DotNetObjectReference1.ThrowIfDisposed()
at Microsoft.JSInterop.DotNetObjectReference1.get_Value()
at Plotly.Blazor.PlotlyJsInterop.d__3.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Plotly.Blazor.PlotlyChart.d__49.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

Code being used to update the chart:

if (_chart != null) { await InvokeAsync(async () => { await _chart.React(); }); }

This same code works fine for the Line (Scatter) charts for updating values in realtime/manual refresh.

@ftkus
Copy link

ftkus commented Aug 1, 2022

I also get this error rather frequently. Truthfully, I just wrapped it in a try/catch/do nothing and ignore it for now (Chart will update on my next cycle), but if there is a better solution I would love to hear it.

@sean-mcl sean-mcl added the bug Something isn't working label Oct 18, 2022
@asyfong
Copy link

asyfong commented Sep 19, 2023

FWIW I am also getting the same error on a waterfall chart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants