Cannot read property of undefined error on page load after upgrading to 18.3.0.35

Hello

I have a grid with a column with a Filter template like this:



Since upgrading to 18.3.0.35 I am on occasions getting an error (see below) when the page loads.  This did not happen in the previous version.  It is difficult to recreate a sample for you, but this looks suspiciously like an error that a number of users (including our team) encountered after the last major release.


Any ideas?









10 Replies

SP Sureshkumar P Syncfusion Team October 6, 2020 05:51 AM UTC

Hi Richard, 
 
Greetings from Syncfusion support. 
 
Based on your shared information, we have created the sample and try to replicate the reported issue from our end. but the reported issue not replicated from our end.  
 
Please find the code example here: 
@using Syncfusion.Blazor.Calendars 
 
<SfDateRangePicker @bind-StartDate="@StartDate" @bind-EndDate="@EndDate" @ref="@RangeObject"> 
    <DateRangePickerEvents OnClose="@ClosePopup"></DateRangePickerEvents> 
</SfDateRangePicker> 
@code { 
    SfDateRangePicker RangeObject; 
    public DateTime? StartDate { get; set; } 
    public DateTime? EndDate { get; set; } 
 
    public void ClosePopup(RangePopupEventArgs args) 
    { 
 
    } 
} 
 
 
Also, we have checked the reported issue in the grid component. but not replicated the reported issue, please refer the code example. 
@using Syncfusion.Blazor.Data 
@using Syncfusion.Blazor.Grids 
@using Syncfusion.Blazor.DropDowns 
@using Syncfusion.Blazor.Calendars 
<SfGrid @ref="@Grid" DataSource="@Orders" AllowFiltering="true" AllowPaging="true" Height="315"> 
    <GridColumns> 
        <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn> 
        
        <GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"> 
            <FilterTemplate> 
                <SfDateRangePicker @ref="Range" @bind-StartDate="@StartDate" @bind-EndDate="EndDate" Placeholder="Choose a Range"></SfDateRangePicker> 
            </FilterTemplate> 
        </GridColumn> 
        <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn> 
    </GridColumns> 
</SfGrid> 
 
@code{ 
    SfGrid<Order> Grid; 
    SfDateRangePicker Range { get; set; } 
    public DateTime? StartDate { get; set; } = DateTime.Now; 
    public DateTime? EndDate { get; set; } = DateTime.Now.AddDays(+3); 
    public List<Order> Orders { get; set; } 
 
    protected override void OnInitialized() 
    { 
        Orders = Enumerable.Range(175).Select(x => new Order() 
        { 
            OrderID = 1000 + x, 
            CustomerID = (new string[] { "ALFKI""ANANTR""ANTON""BLONP""BOLID" })[new Random().Next(5)], 
            Freight = 2.1 * x, 
            OrderDate = (new DateTime[] { new DateTime(201051), new DateTime(201052), new DateTime(201053), })[new Random().Next(3)], 
        }).ToList(); 
    } 
 
    public class Data 
    { 
        public string CustomerID { get; set; } 
    } 
    List<Data> Dropdown = new List<Data> 
{ 
        new Data() { CustomerID= "All" }, 
        new Data() { CustomerID= "ANTON" }, 
        new Data() { CustomerID= "ANANTR" }, 
        new Data() { CustomerID= "ALFKI" }, 
        new Data() { CustomerID= "BOLID" }, 
        new Data() { CustomerID= "BLONP" }, 
    }; 
 
    public class Order 
    { 
        public int? OrderID { get; set; } 
        public string CustomerID { get; set; } 
        public DateTime? OrderDate { get; set; } 
        public double? Freight { get; set; } 
    } 
 
    public void Change(@Syncfusion.Blazor.DropDowns.ChangeEventArgs<string,Order> args) 
    { 
        if (args.Value == "All") 
        { 
            Grid.ClearFiltering(); 
        } 
        else 
        { 
            Grid.FilterByColumn("CustomerID""contains", args.Value); 
        } 
    } 
} 
 
 
 
We suspect that NuGet cache is not cleared in your application. Please try the following linked KB instructions to get rid of the reported issue at your end.  
 

If still you have facing the issue, then please share the below details. 
1.     If possible, please replicate the reported issue from our above attached sample and revert us with detailed issue replication procedure. 
2.     Whether the reported issue replicated using daterangepicker inside the Grid component or outside the grid component. 
these details will help us to provide exact solution as earlier as possible. 
 
Regards, 
Sureshkumar P 



DI Ditchford October 6, 2020 06:59 AM UTC

Hello

Thanks for the tip about the nuget cache.  I have cleared and will advise if the problem reoccurs.

Regards


SP Sureshkumar P Syncfusion Team October 7, 2020 05:05 AM UTC

Hi Richard, 
 
Thanks for your update.

 
Regards,
Sureshkumar P
 



SL Steven Littleford October 13, 2020 11:15 AM UTC

Nope - i cleared my cache and am still intermittently getting this error.


DI Ditchford October 14, 2020 03:25 AM UTC

Hey Sureshkumar

I have tried clearing the nuget cache. I still have the problem (I note Steven has encountered the same issue).  I am trying to create a sample for you, but this is proving really hard.  I have now experienced the issue with both 'CalendarBase' and 'DropdownBase'.  I have attached a video of the problem as I am not sure I am going to be able to create a sample for you.


Any ideas on how we progress with this, because I am completely stuck and need to resolve this.

Thanks



Attachment: UpgradeBug_f1fe7835.zip


SP Sureshkumar P Syncfusion Team October 19, 2020 12:37 PM UTC

Hi Richard, 
 
Thanks for your update. 
 
We suggest you use manual scripts other than the scripts from NuGet package, register the Blazor service in ~/Startup.cs file by using true parameter as mentioned below. 
 
Please find the code example here: 
using Syncfusion.Blazor; 
 
namespace WebApplication1 
{ 
    public class Startup 
    { 
        public void ConfigureServices(IServiceCollection services) 
        { 
           .... 
           .... 
           services.AddSyncfusionBlazor(true); 
        } 
    } 
} 
 
 
 
to know more about manual script rendering. Please refer the documentation link: https://blazor.syncfusion.com/documentation/getting-started/server-side-blazor/  
 
Regards, 
Sureshkumar P 



DI Ditchford October 20, 2020 01:39 AM UTC

Hello Sureshkumar

Thanks!  We are getting somewhere.  That seems to fix the CalendarBase/DropdownBase issue.  It has, however, introduced another error. The new error, however, does not break the page, but it would be good to get rid of the blood in the console.  So a few questions:

1. The documentation in the link (https://blazor.syncfusion.com/documentation/getting-started/server-side-blazor) you sent is a bit thin on detail.  I assume this means that after changing  services.AddSyncfusionBlazor() to services.AddSyncfusionBlazor(true) in startup.cs then I need to add the following to the _Host.cshtml page?:

<script src="https://cdn.syncfusion.com/blazor/18.3.40/syncfusion-blazor.min.js"></script>

2. If I am using other Syncfusion libraries, do these need to be added to the _Host.cshtml file as well (and what is the exact cdn url if so).  We are currently using:

- Syncfusion.Blazor.PDFViewerServer.Windows
Syncfusion.DocIORenderer.Net.Core

3. The new error that we are now encountering is :



4. Finally.  I guess this is a bit of a work-around solution.  Will Syncfusion fix this issue so that we can revert to services.AddSyncfusionBlazor() .  It is very clean not having to worry about updating the _Host file references every time there is a release.

Thank you for your help.  It is very much appreciated as this problem was a show-stopper for us.

Regards







SN Sevvandhi Nagulan Syncfusion Team October 21, 2020 02:08 PM UTC

Hi Ditchford,  



Query 1:  The documentation in the link (https://blazor.syncfusion.com/documentation/getting-started/server-side-blazor) you sent is a bit thin on detail.  I assume this means that after changing  services.AddSyncfusionBlazor() to  

services.AddSyncfusionBlazor(true) in startup.cs then I need to add the following to the _Host.cshtml page?: 

<script src="https://cdn.syncfusion.com/blazor/18.3.40/syncfusion-blazor.min.js"></script> 

Yes, we add the above script in the Host.cshtml when using the true in AddSyncfusionBlazor.  


Query 2: If I am using other Syncfusion libraries, do these need to be added to the _Host.cshtml file as well (and what is the exact cdn url if so).  We are currently using:  

- Syncfusion.Blazor.PDFViewerServer.Windows  


We need to refer the below scripts in _Host.cshtml when services.AddSyncfusionBlazor(true) is provided in Startup.cs. But currently we are facing the reported error in the latest version 18.3.0.35. We forwarded these details to corresponding and we will get back to us within 2 business days. We appreciate your patience until then.  


Query 3: If I am using other Syncfusion libraries, do these need to be added to the _Host.cshtml file as well (and what is the exact cdn url if so).  We are currently using:  

- Syncfusion.DocIORenderer.Net.Core  

DocIO Word library is server side control and it doesn’t need script related changes. Also, it doesn’t require any script to include in application.  

Query 4: The new error that we are now encountering is : 

 
We checked the reported requirement. Could you let us know in which case you will be facing the above problem?.  Also provide the code snippet or sample for the above issue. 

Query 5: Finally.  I guess this is a bit of a work-around solution.  Will Syncfusion fix this issue so that we can revert to services.AddSyncfusionBlazor() .  It is very clean not having to worry about updating the _Host file references every time there is a release. 


We forwarded these details to corresponding and we will get back to us within 2 business days. We appreciate your patience until then. 



Regards,  
Sevvandhi N 



DI Ditchford October 26, 2020 10:27 PM UTC

Hello

There are a number of outstanding issues that you were going to get back to me on within 2 business days.  Specifically Queries 2 and 5.

Can you le me know please, this is getting critical for us.

Thank you 


DM Dhivyabharathi Mohan Syncfusion Team October 14, 2021 08:09 AM UTC

Hi Ditchford, 
 
 
Sorry for the inconvenience. We have fixed the reported issues in the latest version v19.3.0.45. Kindly upgrade to the latest version to get the issue resolved. And we have shared the Blazor sample in the latest version for your reference which can be downloaded from the below link. 
 
 
 
 
Kindly try this and revert us, if you have any concerns. 
 
 
Regards, 
Dhivya. 


Loader.
Up arrow icon