Sporadic error with SFDatePickerPicker

Hello,

I get the following error in logs extremely sporadically

```
Error: Microsoft.JSInterop.JSException: Cannot read property 'CalendarBase' of undefined
TypeError: Cannot read property 'CalendarBase' of undefined
    at Module../bundles/daterangepicker.js (https://localhost:44382/_content/Syncfusion.Blazor/scripts/daterangepicker-ecff47.min.js:1:114730)
    at s (https://localhost:44382/_content/Syncfusion.Blazor/scripts/daterangepicker-ecff47.min.js:1:110)
    at https://localhost:44382/_content/Syncfusion.Blazor/scripts/daterangepicker-ecff47.min.js:1:937
    at https://localhost:44382/_content/Syncfusion.Blazor/scripts/daterangepicker-ecff47.min.js:1:975
   at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
   at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
   at Syncfusion.Blazor.Internal.SfBaseUtils.ImportScripts(IJSRuntime jsRuntime, String modulePath)
   at Syncfusion.Blazor.Internal.SfBaseUtils.ImportModules(IJSRuntime jsRuntime, List`1 scriptModules, String hashKey)
   at Syncfusion.Blazor.BaseComponent.InitComponent()
   at Syncfusion.Blazor.BaseComponent.OnAfterRenderAsync(Boolean firstRender)
   at Syncfusion.Blazor.Calendars.SfDateRangePicker.OnAfterRenderAsync(Boolean firstRender)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
```

Things still work of but I'm trying to catch the cause of this error and I cant properly reproduce it myself even.
Would there be any case that you are aware of that may cause this.
Any hint or direction would help

Regards
Vincent

8 Replies 1 reply marked as answer

JM Jeyanth Muthu Pratheeban Sankara Subramanian Syncfusion Team October 15, 2020 07:18 AM UTC

Hi Vincent, 

Thanks for contacting Syncfusion support. 

We would like to let you know that, the static webassets will always be cached in the browser when we using Blazor WebAssembly application since the resources are loaded in the browser side for rendering.    
     
So, we suggest you to set the HTTP header with no-cache option in your server configuration to resolve this problem. Please refer to the below Github thread and ASP.NET forum for more details.    
     
     
Regards, 
Jeyanth. 



NT NARWAL TECNOLOGIA SA October 28, 2020 07:48 PM UTC

Hello,

I am using server-side blazor and this error is also occurring, a few times it happens as soon as the page that has the DateRangePicker loads, sometimes after several reloads of the page


SN Sevvandhi Nagulan Syncfusion Team October 29, 2020 07:09 AM UTC

Hi NARWAL,   


Thanks for contacting Syncfusion support.   


The cause for the script error “Cannot read property 'CalendarBase' of undefined” due to resources were not loaded properly also due to NuGet cache. So we suggest you to clear the NuGet by following the below link.     
  

    
Please let us know if you need any further assistance on this.   


Regards,   
Sevvandhi N 



NT NARWAL TECNOLOGIA SA November 4, 2020 02:07 PM UTC

Hello,

I cleared the cache but the problem persists


JE Jesús November 5, 2020 07:33 AM UTC

Same here, tried the nuget cache clraring method but still having this error.

I also confirm it is an sporadic error, not sure how to reproduce myself, it just appears randomly.

Regards.


BC Berly Christopher Syncfusion Team November 5, 2020 11:43 AM UTC

Hi Jesús, 
  
The reported issue is a very rare case issue. This is not able to replicate when repeatedly with same replication steps. So, we have considered this issue as our improvement feature. We have working our improvement task now. We have added this scenario to that task, and we will expect to be rolled out this feature in our Volume 4 main release which is scheduled on end of December 2020. We appreciate your patience until then.  
  
Please follow the feedback to our improvement feature: 
  
So, we suggest you use manual script reference to avoid this issue until we will provide the support. To know more about this, please refer the below documentation. 
  
  
Regards, 
Berly B.C 



TR Travis November 14, 2020 04:08 AM UTC

I receive the exception quite often.  About 1 in 3 visits to a page with a Date Range Picker fails.  I don't think it is very rare.
Clearing the Cache did not resolve the error.  Going to CDN caused other errors.

[2020-11-14T03:19:02.024Z] Error: Microsoft.JSInterop.JSException: Cannot read property 'CalendarBase' of undefined
TypeError: Cannot read property 'CalendarBase' of undefined
    at Module../bundles/daterangepicker.js (https://localhost:44354/_content/Syncfusion.Blazor/scripts/daterangepicker-02f9b7.min.js:1:115089)
    at s (https://localhost:44354/_content/Syncfusion.Blazor/scripts/daterangepicker-02f9b7.min.js:1:110)
    at https://localhost:44354/_content/Syncfusion.Blazor/scripts/daterangepicker-02f9b7.min.js:1:937
    at https://localhost:44354/_content/Syncfusion.Blazor/scripts/daterangepicker-02f9b7.min.js:1:975
   at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
   at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
   at Syncfusion.Blazor.Internal.SfBaseUtils.ImportScripts(IJSRuntime jsRuntime, String modulePath)
   at Syncfusion.Blazor.Internal.SfBaseUtils.ImportModules(IJSRuntime jsRuntime, List`1 scriptModules, String hashKey)
   at Syncfusion.Blazor.BaseComponent.InitComponent()
   at Syncfusion.Blazor.Internal.ResourceManager.OnAfterRenderAsync(Boolean firstRender)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)


BC Berly Christopher Syncfusion Team November 16, 2020 11:47 AM UTC

Hi Travis, 
  
Sorry for the inconvenience caused. 
  
As we mentioned earlier, the reported issue will be resolved in our upcoming Volume 4 Main release which is expected to be scheduled on end of December 2020. 
  
Also, when we are using the CDN link, there is no issues occurred at our end and DateRangePicker component is working fine. We have prepared the sample and attached it below. 
  
  
Please check the above sample and share the below details that will help us to check and proceed further at our end. 
1.       What are the issues which you have faced while using CDN link ( Going to CDN caused other errors.
2.       Any issue reproducing sample along with replication procedure. 
3.       Have you rendered any other components in the page? 
4.       Have you faced this issue on rendering the DateRangePicker component alone? 
  
Regards, 
Berly B.C 


Marked as answer
Loader.
Up arrow icon