Getting the following error in the browser console when leaving a page via a button before the charts have completed rendering.
blazor.server.js:19 [2021-02-19T09:31:25.157Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Blazor.Charts.SfChart.CalculateAvailableSize()
at Syncfusion.Blazor.Charts.SfChart.SetContainerSize()
at Syncfusion.Blazor.Charts.SfChart.OnAfterScriptRendered()
at Syncfusion.Blazor.SfBaseComponent.OnAfterRenderAsync(Boolean firstRender)
at Syncfusion.Blazor.SfDataBoundComponent.OnAfterRenderAsync(Boolean firstRender)
at Syncfusion.Blazor.Charts.SfChart.OnAfterRenderAsync(Boolean firstRender)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
e.log @ blazor.server.js:19
Attached is a test case. The charts are rendered on the counter page. The error only occurs if you exit the counter page via the button before the charts appear. Note the test case gives a different error to the one in our application.
[2021-02-19T10:54:21.855Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Blazor.Charts.SfChart.RefreshAxis()
at Syncfusion.Blazor.Charts.SfChart.InitPrivateVariable()
at Syncfusion.Blazor.Charts.SfChart.RenderChart()
at Syncfusion.Blazor.Charts.SfChart.OnAfterScriptRendered()
at Syncfusion.Blazor.SfBaseComponent.OnAfterRenderAsync(Boolean firstRender)
at Syncfusion.Blazor.SfDataBoundComponent.OnAfterRenderAsync(Boolean firstRender)
at Syncfusion.Blazor.Charts.SfChart.OnAfterRenderAsync(Boolean firstRender)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
Attachment:
ChartError_c0350db1.zip