Exception on DatasourceUpdate

Hello,

i updated my solution from 31.xx to 32.xx without any changes in sourcecode.

Now, when I open a component with a SfGrid it throws an exception on the console.


 ( Datasource is {get;set;}= new () by default.)

This only happens, when i load/update the data in OnInitializedAsync Method.

When I sourround the grid with if(ready)  {} )-statement this does not happen.

   protected override async Task OnInitializedAsync()

    {

     CustomerData= await GetCustomerDataAsync();

}


16 Replies

MK Matthias Krüger January 22, 2026 02:34 PM UTC

this is the exception:

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]

      Unhandled exception rendering component: Unhandled exception occurred during interop call.

System.InvalidOperationException: Unhandled exception occurred during interop call.

 ---> Microsoft.JSInterop.JSException: TypeError: Cannot read properties of undefined (reading 'refreshOnDataChange')

 ---> TypeError: Cannot read properties of undefined (reading 'refreshOnDataChange')

   Exception_EndOfInnerExceptionStack

   at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeJS(JSInvocationInfo& )

   at Microsoft.JSInterop.JSInProcessRuntime.Invoke[IJSVoidResult](String , Int64 , JSCallType , Object[] )

   at Microsoft.JSInterop.JSInProcessRuntime.Invoke[IJSVoidResult](String , Object[] )

   at Microsoft.JSInterop.JSInProcessRuntimeExtensions.InvokeVoid(IJSInProcessRuntime , String , Object[] )

   at Syncfusion.Blazor.Internal.SfBaseUtils.InvokeMethod(IJSRuntime jsRuntime, String methodName, Object[] methodParams)

   Exception_EndOfInnerExceptionStack

   at Syncfusion.Blazor.Internal.SfBaseUtils.InvokeMethod(IJSRuntime jsRuntime, String methodName, Object[] methodParams)

   at Syncfusion.Blazor.SfBaseComponent.InvokeMethod(String methodName, Object[] methodParams)

   at Syncfusion.Blazor.Grids.Internal.VirtualScroll`1.<CheckAndResetCache>d__165[[SmartstoreWeb.Shared.Implementations.Adresse, SmartstoreWeb.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()

   at Syncfusion.Blazor.Grids.SfGrid`1.<ModelChanged>d__1275[[SmartstoreWeb.Shared.Implementations.Adresse, SmartstoreWeb.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()

   at Syncfusion.Blazor.Grids.SfGrid`1.<OnParametersSetAsync>d__9[[SmartstoreWeb.Shared.Implementations.Adresse, SmartstoreWeb.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()

   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)



MK Matthias Krüger January 22, 2026 02:54 PM UTC

this looks like a timing problem. it only appears, when i clear the app cache AND update the datasource in OnInitializedAsync()



GR Guhanathan Ramanathan Syncfusion Team January 23, 2026 08:44 AM UTC

Hi Matthias Krüger ,

Based on your query, we understand that you are encountering an exception while rendering the Grid after upgrading to version 32. To investigate this further, we created a sample and attempted to reproduce the reported issue in version 32. However, in our testing, the Grid rendered properly. Please refer the below sample for your reference.

Sample:https://blazorplayground.syncfusion.com/embed/LtVnNWBqVzMBtXNm?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5


Since we suspect, the issue is related to the CDN version not updating to the latest, please ensure that you are referring to the latest CDN version.

Please refer the below lines to refer the script and the theme on the App.razor file.

For CDN Nuget reference

 

<link rel='nofollow' href=”https://cdn.syncfusion.com/blazor/32.1.24/styles/bootstrap5.css” rel="stylesheet" />

 

   <script src=”https://cdn.syncfusion.com/blazor/32.1.24/syncfusion-blazor.min.js” type="text/javascript"></script>

 

If the reported issue still reproduced, then kindly share the below details to validate further at our end.

    1. Could you share the complete Grid rendering code along with the model class? This will help us review your Grid configuration.
    2. Could you clear the cache after upgrading the version and delete the bin and obj folders? Then verify if the issue persists.
    3. Please provide a simple issue replicating sample or try to modify the above-mentioned sample.

    4. Please share the App.razor file from your end to check the script reference from our end.

    5. Share us the video demonstration of the reported issue

Above requested details will be very helpful in validating the reported query at our end and providing a solution as early as possible. Thanks for your understanding.

Regards,

Guhanathan R



RA Rahulan February 3, 2026 01:12 PM UTC

Hi, 

I'm also experiencing the same issue after upgrading to version 32.x from 31.x. Ticket Ref: 

807855. 

Looks like this is a breaking change in version 32.x.


Best Regards.

Rahul

 



MK Matthias Krüger February 3, 2026 01:23 PM UTC

It seems to be some kind of race condition, depending on whether data loading or layout rendering finishes first.

In my opinion, syncfusion.blazor.web.js is loading too slowly.

The problem occurs when the file is not loaded from cache but from the server, or when an empty List<T> is replaced with real data.

Wrapping the grid in

@if (_ready)

{

    <SfGrid ...>

}

and setting _ready like this:

protected override async Task OnInitializedAsync()

{

    await LoadSomeData();

    _ready = true;

}


fixes the issue, but introduces a noticeable delay in page loading.



NP Naveen Palanivel Syncfusion Team February 4, 2026 09:06 AM UTC

Hi Matthias Krüger,

We apologize for the trouble this issue has caused.

We understand that you are still experiencing the problem on your end and are currently using a workaround to manage the reported issue. Based on the details you shared, we created a sample on our side to reproduce the issue. However, we were unable to replicate the problem. Please refer to the attached sample for your reference.

To further validate the reported issue, please provide the following details to help us investigate further:

  • Could you share the complete Grid rendering code along with the model class? Based on your Grid configuration, we attempted to adjust our sample to replicate the issue.

  • Share us the video demonstration of the issue with elaborately, it will be more useful to us.

  • Provide a simple reproducible sample or try to reproduce the issue using our shared sample. This would help us validate and provide a better solution.


The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible


Sample: Check the attachment.

Regards,
Naveen


Attachment: BlazorApp6_979f9dc2.zip


MK Matthias Krüger February 9, 2026 01:43 PM UTC

It is not possible for me to reproduce the issue in a demo application, however the problem still exists in my application.

It occurs across various Grid events, for example when calling AutoFitColumns inside the DataBound event.

Please find an attached GIF and a code snippet for reference.

Adding a Task.Delay(500) inside the DataBound event works around the issue and prevents it from occurring.

  private async Task GridBestandsucheDataBound()

    {

        if (Bestandliste != null && Bestandliste.Any())

        {

           // await Task.Delay(500);

            await GridBestandsuche.AutoFitColumnsAsync();

         }


    }

        <SfGrid @key="GridBestandsucheKey" @ref="GridBestandsuche" AllowResizing="true" @onkeydown="GridBestandsucheKeyDown" DataSource="Bestandliste" EnableVirtualization="false" TValue="BestandAggregatDto" Height="100%" Width="100%" AllowSorting="true" AllowSelection="true" AllowReordering="true">

            <GridKeySettings MoveDownCell="ArrowDown"></GridKeySettings>


            <GridSelectionSettings EnableToggle="true" EnableSimpleMultiRowSelection="false" CheckboxOnly="false" CheckboxMode="CheckboxSelectionType.ResetOnRowClick" Type="SelectionType.Multiple"> </GridSelectionSettings>

            <GridEvents TValue="BestandAggregatDto" OnRecordDoubleClick="GridBestandsucheDoubleClick" DataBound="GridBestandsucheDataBound"></GridEvents>

            <GridColumns>….

 


Attachment: error_c618317a.gif


GR Guhanathan Ramanathan Syncfusion Team February 10, 2026 09:56 AM UTC

Hi Matthias Krüger,

Based on your query, we understand that you are encountering an exception while rendering the Grid after upgrading to version 32. Upon reviewing your provided gif we suspect that you are rendering grid inside the dialog. We would like to inform you that we have already logged an issue titled “
Console error occurs during initial rendering when the Grid is rendered inside the Tab component nested in SfDialog” for the same scenario and this fix will be included in our patch release which is expected to be rolled out on February 13th , 2026.

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.     

 

Feedback:https://www.syncfusion.com/feedback/72612/console-error-occurs-during-initial-rendering-when-the-grid-is-rendered-inside-the

Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.

Please check the reported issue in the latest version released tomorrow. If the issue still persists, kindly let us know. We have already reviewed the code snippet you provided, and the issue does not occur on our side. Therefore, we request you to share a reproducible sample so we can investigate further.

 

Regards,
Guhanathan R



MK Matthias Krüger February 10, 2026 10:28 AM UTC

Thank you very much for your response.

Yes, that is exactly the issue I´m experiencing. I am very glad that the root cause has been identified and that the fix is already planned.

I will wait for the scheduled patch on February 13th.

Many thanks for the excellent support




MK Matthias Krüger February 11, 2026 07:52 AM UTC

Good morning, 


I installed Update 32.2.4 but the issues still exist.

All pages are running inside SfTabControl


  1. - SfDialog opens component with SfDatagrid
  2. -OnDatabound ->await refObj.AutofitColumnsAsync():
  3. Error: Microsoft.JSInterop.JSException: TypeError: Cannot read properties of undefined (reading 'autoFitColumns')

Next Issue:
  1. Dialog with Grid is opened. 
  2. During Loading Dialog is destroyed because of dialog programatically closing in OpenExternally()
  3. Error: ---> Microsoft.JSInterop.JSException: TypeError: Cannot read properties of undefined (reading 'element')
  4.  Code: <SfDialog Height="calc(100vh - 300px)" Width="100%" Visible="@DisplayBestaende" ShowCloseIcon="true" AllowDragging="true" EnableResize="true" Target="@($"#{UniqueId}")">

         <DialogPositionData X="0" Y="0"></DialogPositionData>

         <DialogEvents Closed="BestaendeDialogOnClose"></DialogEvents>

         <DialogTemplates>

             <Content>

                 <div class="d-flex flex-column overflow-scroll">

                     <div class="flex-grow-0">

                         <SfButton type="button" Content="⤴️ Im Tab öffnen" CssClass="e-link" @onclick="() => { OpenExternally(Suchmodel); }" />

                     </div>

                     <div class="flex-grow-1">

                         <Lagerbestand Suchmodel="@Suchmodel" @key="SuchmodelKey" Search="true" OnBestandGewaehlt="OnBestandGewaehlt"></Lagerbestand>

                     </div>

                 </div>


             </Content>

         </DialogTemplates>


     </SfDialog>




SK Sanjay Kumar Suresh Syncfusion Team February 12, 2026 02:43 PM UTC

Hi Matthias Krüger,


Query: I installed Update 32.2.4 but the issues still exist.


Based on your query, we understand that the console error continues to occur even after updating the NuGet package from your end. We suspect that this issue may be related to cached project files. Therefore, we recommend deleting the bin and obj folders from your project, performing a full project clean, and then redeploying the application to ensure that all cached data is cleared. Additionally, we have shared the sample verified from our side for your reference. Please review.


Sample: https://drive.google.com/file/d/1P3eViIrpmKA21Jp8cp5E6xaB67XN5NHW/view?usp=drive_link


If the reported issue still reproduced, then kindly share the below details to validate further at our end.


      1. Please provide a simple issue replicating sample or try to modify the above-mentioned sample.

      2. Please share you complete Grid code snippet.


The above requested detail will be very helpful for us to validate the reported issue at our end.



Query: Error: Microsoft.JSInterop.JSException: TypeError: Cannot read properties of undefined (reading 'autoFitColumns')


We have confirmed that this is an issue and logged a defect report titled  “Console Error throws while invoking the AutoFitColumnsAsync, when the Grid is rendered inside SfDialog” This fix will be included in our weekly patch release, which is expected to be rolled out on February 17th, 2026. 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.    


https://www.syncfusion.com/feedback/72707/console-error-throws-while-invoking-the-autofitcolumnsasync-when-the-grid-is


Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization”


We will get back to you once the release is rolled out. Until then we appreciate your patience.


Query: Microsoft.JSInterop.JSException: TypeError: Cannot read properties of undefined (reading 'element')


Based on your query, we understand that you are encountering a console error when the Grid is rendered inside a dialog, and the dialog is being destroyed through a button click within its content. To validate this, we created a sample replicating the same structure and behavior you described. However, we were unable to reproduce the reported issue on our end. We have attached the sample used for our verification. Please check.


Sample: https://drive.google.com/file/d/1OddymuLxDTLlNGWYIP8OagzxElcc0MrP/view?usp=drive_link


Before proceeding with the reported requirement, we require some additional clarification from your end. Please share the below details to proceed further at our end.


      1. Please provide a simple issue replicating sample or try to modify the above-mentioned sample.

      2. Share us the complete stack trace of the console error.

      3. Share us the entire Grid code snippet, along with the SfDialog code.
 

The above requested detail will be very helpful for us to validate the reported issue at our end.


Regards,

Sanjay Kumar Suresh



MK Matthias Krüger February 12, 2026 03:19 PM UTC

Hi  Sanjay Kumar Suresh,

I am sorry. 

  • Error 1 seems to be gone now but the issue looked same to me because of  " Cannot read properties of undefined"  Exception on Console.  (.js not available in time ?)
  • Error 2 'AutoFit' absolutely exists and apperas same as in your playground-demo
  • Error3 only appears when I close the Dialog during layout changes e.g Fitting columns. When I wait until document is fully loaded and count to 3 , the error does not appear.





SK Sanjay Kumar Suresh Syncfusion Team February 13, 2026 12:18 PM UTC

Hi Matthias Krüger,


Query 1: Error 1 seems to be gone now 

We are glad to know that the provided solution was helpful.


Query 2: Error 2 'AutoFit' absolutely exists and apperas same as in your playground-demo

Since the reported issue has been logged as a bug from our side, our development team is currently working on the fix. We kindly request you to wait until February 17, 2026 for the resolution.
We appreciate your patience and understanding while we work to address this at the earliest.


Query 3: Error3 only appears when I close the Dialog during layout changes e.g Fitting columns. When I wait until document is fully loaded ...

To further investigate the issue from our side, we will need additional details from you. The information currently available is not sufficient to validate or reproduce the problem. So, please share the details requested below to validate the issue from our end. 

Sample: https://drive.google.com/file/d/1OddymuLxDTLlNGWYIP8OagzxElcc0MrP/view?usp=drive_link


Please share the below details to proceed further at our end.

      1. Please provide a simple issue replicating sample or try to modify the above-mentioned sample.

      2. Share us the complete stack trace of the console error.

      3. Share us the entire Grid code snippet, along with the SfDialog code.


The above requested detail will be very helpful for us to validate the reported issue at our end.



SK Sanjay Kumar Suresh Syncfusion Team February 17, 2026 07:05 AM UTC

Hi Matthias Krüger,


Thanks for your patience.


We are glad to announce that, we have included the fix for the “Console Error throws while invoking the AutoFitColumnsAsync, when the Grid is rendered inside SfDialog” in our “32.2.5 release.  So please upgrade to our latest version of Syncfusion NuGet package to resolve the reported issue. Please find the NuGet package for latest fixes and features from below.


NuGet: https://www.nuget.org/packages/Syncfusion.Blazor.Grid


Sample: https://blazorplayground.syncfusion.com/embed/hZhntBiwVDLmgoHW?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5


Root Cause:

Access to an undefined resizemodule property in AutofitColumns caused a script error (the property was referenced before being set).


Corrective Actions Taken:

Added a null/undefined check for resizemodule in AutofitColumns to prevent early access and eliminate the script error.


Regards,

Sanjay Kumar Suresh



ST smart trauma July 2, 2026 03:40 AM UTC

A script error occurred when an undefined resizemodule property in AutofitColumns was accessed (the property was referenced before being set).  https://blazorplayground.syncfusion.com/embed/hZhntBiwVDLmgoHW?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5 snowrider



SK Sanjay Kumar Suresh Syncfusion Team July 2, 2026 02:34 PM UTC

Hi smart trauma,


Greetings from Syncfusion,


Based on your query, it appears that you may be encountering a JavaScript interop script error during application deployment. This issue can occur if the required script references are missing, incorrect, or not properly loaded in the application.

To help resolve the issue, please verify the following on your end:

dotnet add package Syncfusion.Blazor

 


In your App.razor (for Blazor WebApp), add the required Syncfusion script references.


<script src="_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js"></script>

 


 In your Program.cs file, make sure you have registered the Syncfusion Blazor service:

builder.Services.AddSyncfusionBlazor();

 


Add the required CSS file reference in your App.razor or index.html:


<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap5.css" rel="stylesheet" />

 


Ensure you have the correct namespace imports in your _Imports.razor file:


@using Syncfusion.Blazor
@using Syncfusion.Blazor.Popups

@using Syncfusion.Blazor.Grids


Documentation Reference:

https://blazor.syncfusion.com/documentation/dialog/getting-started#add-stylesheet-and-script-resources

https://blazor.syncfusion.com/documentation/datagrid/getting-started


If the reported issue can still be reproduced, please provide the following details so that we can investigate further:


  1. Please share any console errors or stack traces observed on your end.
  2. Please provide a video recording demonstrating the reported issue.
  3. Please share a simple sample that reproduces the issue or modify the shared sample to demonstrate the problem.
  4. Please clear the bin and obj folders in your project, clear your browser cache, and verify whether the issue still persists.
  5. Please run the application in an incognito/private browser window and confirm whether the issue continues to occur.


The above requested detail will be very helpful for us to validate the reported issue at our end.


Regards,

Sanjay Kumar Suresh


Attachment: BlazorWASMWebApp_7cb9d7a1.zip

Loader.
Up arrow icon