Blazor grid with large record set breaks circuit when navigating away before render is complete

I get the following error using the grid in Blazor.  It occurs when rendering a large recordset, and when the user navigates away from the view before the grid is fully rendered. I suspect the grid continues to render after its owner component is disposed (becomes null). 

For a workaround, I looked for a way to request the grid to cancel a render when the owner component disposes.  I also looked for events to tell me whether the grid has commenced and/or completed all renders (so that I can make the user wait). I was not able to find either. If this is possible, could you guide me in that direction?

Also note, this error does not occur when AllowPaging is true however that is not an option for my client. It also does not seem to occur after the initial render, but in subsequent renders.. like for sorting, or column spacing, etc. 


TypeError: Cannot set property 'blazor__instance' of null
    at new t (https://localhost:5001/_content/Syncfusion.Blazor/scripts/sf-grid-580d73.min.js:1:103664)
    at Object.initialize (https://localhost:5001/_content/Syncfusion.Blazor/scripts/sf-grid-580d73.min.js:1:117349)
    at https://localhost:5001/_framework/blazor.server.js:8:31421
    at new Promise (<anonymous>)
    at e.beginInvokeJSFromDotNet (https://localhost:5001/_framework/blazor.server.js:8:31390)
    at https://localhost:5001/_framework/blazor.server.js:1:19202
    at Array.forEach (<anonymous>)
    at e.invokeClientMethod (https://localhost:5001/_framework/blazor.server.js:1:19173)
    at e.processIncomingData (https://localhost:5001/_framework/blazor.server.js:1:17165)
    at e.connection.onreceive (https://localhost:5001/_framework/blazor.server.js:1:10276)
Microsoft.JSInterop.JSException: Cannot set property 'blazor__instance' of null
TypeError: Cannot set property 'blazor__instance' of null
    at new t (https://localhost:5001/_content/Syncfusion.Blazor/scripts/sf-grid-580d73.min.js:1:103664)
    at Object.initialize (https://localhost:5001/_content/Syncfusion.Blazor/scripts/sf-grid-580d73.min.js:1:117349)
    at https://localhost:5001/_framework/blazor.server.js:8:31421
    at new Promise (<anonymous>)
    at e.beginInvokeJSFromDotNet (https://localhost:5001/_framework/blazor.server.js:8:31390)
    at https://localhost:5001/_framework/blazor.server.js:1:19202
    at Array.forEach (<anonymous>)
    at e.invokeClientMethod (https://localhost:5001/_framework/blazor.server.js:1:19173)
    at e.processIncomingData (https://localhost:5001/_framework/blazor.server.js:1:17165)
    at e.connection.onreceive (https://localhost:5001/_framework/blazor.server.js:1:10276)
   at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
   at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
   at Syncfusion.Blazor.SfBaseComponent.InvokeMethod(String methodName, Object[] methodParams)
   at Syncfusion.Blazor.Grids.SfGrid`1.OnAfterScriptRendered()
   at Syncfusion.Blazor.SfBaseComponent.OnAfterRenderAsync(Boolean firstRender)
   at Syncfusion.Blazor.SfDataBoundComponent.OnAfterRenderAsync(Boolean firstRender)
   at Syncfusion.Blazor.Grids.SfGrid`1.OnAfterRenderAsync(Boolean firstRender)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
      Unhandled exception in circuit 'fiohJ5_JhuqWuqkPKyExl8qWgJ8BPqPwgkG1WVFXfx0'.

1 Reply

VN Vignesh Natarajan Syncfusion Team July 20, 2020 12:47 PM UTC

Hi Dan,  
 
Greetings from Syncfusion support.   
 
Query: “It occurs when rendering a large recordset, and when the user navigates away from the view before the grid is fully rendered 
 
We have validated the reported query at our end and we are able to reproduce the reported issue at our end while switching between the two pages frequently with Grid in it. Since it is known issue, we have already considered it as a bug and logged defect report “Exception occur in grid like "Cannot set property 'blazor__instance' of null" for the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our weekly patch release which is expected to be rolled out on or before 4th August 2020  
 
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link. 
 
 
Till then we appreciate your patience.  
 
Regards, 
Vignesh Natarajan 
 
 


Loader.
Up arrow icon