An error occurs when quickly switching tabs including SfSpinner in SfTab

An error occurs when quickly switching tabs including SfSpinner in SfTab 
Is there a countermeasure? 

 When I made Index.razor of the sample project and tried it, it became as follows.

normal1 ⇔ normal2 
quickly switching ➡ no error

spinner1 ⇔ spinner2
quickly switching ➡ unhandled exception.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Blazor.Spinner.Internal.Bootstrap.ComponentDispose()
   at Syncfusion.Blazor.SfBaseComponent.Dispose(Boolean disposing)
   at Microsoft.AspNetCore.Components.OwningComponentBase.System.IDisposable.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)
Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'OWaO_7WzIXp7woh83jMriNUqBAGZg5sxwPzsd51DORM'.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Blazor.Spinner.Internal.Bootstrap.ComponentDispose()
   at Syncfusion.Blazor.SfBaseComponent.Dispose(Boolean disposing)
   at Microsoft.AspNetCore.Components.OwningComponentBase.System.IDisposable.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)
[2021-03-18T06:54:18.358Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Blazor.Spinner.Internal.Bootstrap.ComponentDispose()
   at Syncfusion.Blazor.SfBaseComponent.Dispose(Boolean disposing)
   at Microsoft.AspNetCore.Components.OwningComponentBase.System.IDisposable.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)

grid1 ⇔ grid2
quickly switching ➡ unhandled exception.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Blazor.Spinner.Internal.Bootstrap.ComponentDispose()
   at Syncfusion.Blazor.SfBaseComponent.Dispose(Boolean disposing)
   at Microsoft.AspNetCore.Components.OwningComponentBase.System.IDisposable.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)
Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit '4KMk2A3WBUSZnDcKxDfrjslUTdiRTJDz0mRPZTo-hVQ'.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Blazor.Spinner.Internal.Bootstrap.ComponentDispose()
   at Syncfusion.Blazor.SfBaseComponent.Dispose(Boolean disposing)
   at Microsoft.AspNetCore.Components.OwningComponentBase.System.IDisposable.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)
[2021-03-18T06:56:04.544Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Blazor.Spinner.Internal.Bootstrap.ComponentDispose()
   at Syncfusion.Blazor.SfBaseComponent.Dispose(Boolean disposing)
   at Microsoft.AspNetCore.Components.OwningComponentBase.System.IDisposable.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)

see sample project.


Attachment: SfTab_in_Spinner_switching_tab_unhandled_exception_20210318_c1ae74da.zip

8 Replies 1 reply marked as answer

IS Indrajith Srinivasan Syncfusion Team March 19, 2021 09:40 AM UTC

Hi Jun, 
 
Greetings from syncfusion support, 
 
We have validated your reported queries “spinner1 spinner2 quickly switching unhandled exception.” && “grid1 grid2 quickly switching unhandled exception.”, the reported script error occurs due to the manual Dispose handled from the application end for the components. We suggest you to call the components dispose method, before handling the TokenSource.Dispose() method from application end to resolved the reported issue. We have also modified, the sample shared with us. 
 
Component.razor 
 
 
<SfSpinner @ref="Spinner" /> 
 
@code { 
 SfSpinner Spinner = default!; 
 
  public void Dispose() 
    { 
        ... 
        Spinner.Dispose(); 
        TokenSource.Dispose(); 
    } 
 
} 
 
GridComponent.razor 
 
 
<SfGrid @ref="DefaultGrid" />  
 
@code  {  
  SfGrid<DataValue> DefaultGrid = new SfGrid<DataValue>(); 
   public void Dispose() 
    { 
        ... 
        DefaultGrid.Dispose(); 
        TokenSource.Dispose(); 
    } 
} 
 
 
Please let us know if the solution helps, 
 
Regards, 
Indrajith 



JM Jun Maeda March 22, 2021 02:36 AM UTC

Thanks you. It happens less frequently, but throws an exception.

We also confirmed that the following error occurs at the same switching speed as before.

spinner2 ⇔ grid1
quickly switching ➡ unhandled exception.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Blazor.Spinner.Internal.Bootstrap.ComponentDispose()
   at Microsoft.AspNetCore.Components.OwningComponentBase.System.IDisposable.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)
Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'JlBxnJI2S6bJu6Fjb1wNf3CSTmfmlbUFzg-ogDL-FNg'.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Blazor.Spinner.Internal.Bootstrap.ComponentDispose()
   at Microsoft.AspNetCore.Components.OwningComponentBase.System.IDisposable.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)
[2021-03-22T02:31:45.100Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Blazor.Spinner.Internal.Bootstrap.ComponentDispose()
   at Microsoft.AspNetCore.Components.OwningComponentBase.System.IDisposable.Dispose()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.TryDisposeInBatch(RenderBatchBuilder batchBuilder, Exception& exception)

see sample project.



Attachment: SfTab_in_Spinner_switching_tab_unhandled_exception_20210322_8567d5d3.zip


RK Revanth Krishnan Syncfusion Team March 22, 2021 09:52 AM UTC

Hi Jun, 
 
 
Good day to you. 
 
 
We have further validated your query “It happens less frequently, but throws an exception when switching between spinner 2  <-> grid” 
 
We tried to reproduce the issue in the shared sample, but we couldn’t reproduce the issue from our end. We have attached the video demo of the sample with the use case scenario for your reference, 
 
 
Can you please share us with the video reference of the reproducible issue? This will be helpful for us to validate and reproduce the issue from our end and assist you at the earliest. 
 
Regards, 
Revanth 



JM Jun Maeda March 23, 2021 12:10 AM UTC

Thanks you.
I will attach the reproduced video.

The environment is debug execution in Visual Studio 2019. 


RK Revanth Krishnan Syncfusion Team March 23, 2021 01:15 PM UTC

Hi Jun,   
   
   
Good day to you. 
   
   
We have validated your query and have considered “Exception throws when the spinner is rendered inside Tab and switching quickly between tabs” as a bug from our end and logged the report for the same and the fix will be included in our patch release on 7th April.     
        
You can now track the current status of the report, review the proposed resolution timeline, and contact us for any further inquiries through this link: https://www.syncfusion.com/feedback/23604 
   
Regards,   
Revanth  



RK Revanth Krishnan Syncfusion Team April 9, 2021 02:01 PM UTC

Hi Jun,  
  
Sorry for the inconvenience.  
  
As we are facing complexity in fixing the issue. We will include the fix in the coming patch release on 14th April.  
  
We appreciate your patience till then.  
  
Regards,  
Revanth 



JM Jun Maeda April 14, 2021 01:05 AM UTC

Thank you for your support.
I've confirmed that switching tabs quickly doesn't cause an error without calling `Dispose ()`.
Confirmed with Syncfusion.Blazor 19.1.0.56. 

Marked as answer

RK Revanth Krishnan Syncfusion Team April 14, 2021 10:21 AM UTC

Hi Jun, 
 
Thank for the update. 
 
We are glad that the reported issue has been resolved. Please let us know if you need any further assistance. 
 
Regards, 
Revanth 


Loader.
Up arrow icon