Chart error when moving off page before render complete

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

4 Replies 1 reply marked as answer

SM Srihari Muthukaruppan Syncfusion Team February 22, 2021 12:24 PM UTC

Hi Michael, 
 
We have analyzed your query. From that, we would like to let you know that we have already considered this scenario as a bug and logged a bug request on this and you can keep track of it from the below feedback portal link. 
       
       
This fix will be available in our weekly patch release which is scheduled to be rolled out on or before 2 March 2021. Meanwhile we will try to provide custom nugget by tomorrow to overcome the reported scenario we appreciate your patience until then.  
  
Regards,  
Srihari M  



SM Srihari Muthukaruppan Syncfusion Team March 2, 2021 06:00 AM UTC

Hi Michael,  
   
We are glad to announce that our v18.4.44 patch release is rolled out, we have added the fix for the reported scenario. And you can use the latest (18.4.44) Syncfusion.EJ2.Blazor NuGet package version and updated interop CDN file to get rid of the reported issue.  
   
   
  
We appreciate your patience in waiting for this release. Kindly let us know if you need further assistance.  
  
Regards,  
Srihari  



KE Kambiz Ezzati June 19, 2021 08:19 AM UTC

Hi 
I'm just checking the exact sample provided here and can see object reference when I switch pages fast.
What you suggest?


SM Srihari Muthukaruppan Syncfusion Team June 21, 2021 11:48 AM UTC

Hi Kambiz, 
 
We have tested the reported scenario by navigating to pages before chart complete rendering and it is working fine. Unfortunately we are unable to reproduce the reported scenario in the latest version 19.1.69 of the chart. Please find the sample used for testing and video for your reference. 
 
 
 
Note: We also suggest you to clear the browser cache before checking the scenario 
 
If you still face this issue. kindly revert us with the following information which will be more helpful for further analysis and provide you the solution sooner. 
 
    1. Try to reproduce the reported scenario in the provided sample.
    2. Share the screenshot of the error faced.
    3. Share the replication procedure for the reported scenario.
 
Regards, 
Srihari M 


Marked as answer
Loader.
Up arrow icon