Could not find 'Radzen.createDatePicker'

Hi

I have a really weird issue with the latest version 4.28.4 also 4.28.3. One of my blazor page is giving me the error below (all other pages are fine). All other pages are OK and it working on my PC (windows). Got the issue only my docker images running on linux. Reverting to 4.27.01 is fixing my issue. Iam doing almost daily update since a year and never got this error... I tryed a different browser with the same issue. Radzen.Blazor.js is loaded

blazor.server.js:1
[2024-03-21T13:15:49.455Z] Error: Microsoft.JSInterop.JSException: Could not find 'Radzen.createDatePicker' ('createDatePicker' was undefined).
Error: Could not find 'Radzen.createDatePicker' ('createDatePicker' was undefined).
at https://dashboard.xx.com/_framework/blazor.server.js:1:734
at Array.forEach ()
at l.findFunction (https://dashboard.xx.com/_framework/blazor.server.js:1:702)
at _ (https://dashboard.xx.com/_framework/blazor.server.js:1:5445)
at https://dashboard.xx.com/_framework/blazor.server.js:1:3238
at new Promise ()
at y.beginInvokeJSFromDotNet (https://dashboard.xx.com/_framework/blazor.server.js:1:3201)
at Xt._invokeClientMethod (https://dashboard.xx.com/_framework/blazor.server.js:1:61001)
at Xt._processIncomingData (https://dashboard.xx.com/_framework/blazor.server.js:1:58476)
at Xt.connection.onreceive (https://dashboard.xx.com/_framework/blazor.server.js:1:52117)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object args)
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object args)
at Radzen.Blazor.RadzenDatePicker`1.OnAfterRenderAsync(Boolean firstRender)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
log @ blazor.server.js:1

1 Like

Hi,
my application threw a similar error.

A security update from Microsoft updated the framework from 7.0.16 to 7.0.17 and I received an error message from VS 2022.

I then updated all components in the project and then the error occurred (the filter on the datagrid automatically loads the DatePicker).

The problem was solved for me by updating the hosting package on the server (Windows with IIS) and explicitly deleting the browser cache!

Maybe it will help you too.

Good luck.

Hi I put < script src="_content/Radzen.Blazor/Radzen.Blazor.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)">< /script>

and moved to the last js and it fixed.

Thanks

1 Like

Had the same error after an update recently. Clearing my browser cache resolved the issue.

It works! Thank you!

Having this same issue, but only on our servers and not locally. This script appears to have fixed it, but I think the underlying issue causing it needs to be addressed.

The underlying issue is cached (old) Radzen.Blazor.js file. This is solved by appending the assembly version in the query string. This way after every upgrade the URL will change thus invalidate any cached versions.

Does anyone know an easy way to do this for Blazor WASM and index.html? I've been searching this for a long time but so far I just manually append a DateTime.Now.Ticks when I find similar issues.

Hey Sofiageo, for Blazor WASM you can't run a dynamically generated version for the script include tag as it's being set in the index.html file. (Not dynamically generated by Blazor)

The simplest way to handle this is every time you update the Nuget package you manually increment the version in the HTML file i.e.

 <script src="_content/Radzen.Blazor/Radzen.Blazor.js?v=4.29.1"></script>

You could probably handle this nicer in a CI-CD to replace the value with that from the Nuget package reference.

1 Like

I just had the same problem and a simple ctrl+F5 fixed it it seems.

1 Like

I have the same problem but noting helped - I upgraded to latest version of Radzen, latest NET 7.0.18 and also added:
< script src="_content/Radzen.Blazor/Radzen.Blazor.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)">< /script>

still get the following:

Error: Could not find 'Radzen.createDatePicker' ('createDatePicker' was undefined).
    at https://.../_framework/blazor.server.js:1:497
    at Array.forEach (<anonymous>)
    at s.findFunction (https://.../_framework/blazor.server.js:1:465)
    at E (https://.../_framework/blazor.server.js:1:2611)
    at https://.../_framework/blazor.server.js:1:3499
    at new Promise (<anonymous>)
    at Ft.beginInvokeJSFromDotNet (https://.../_framework/blazor.server.js:1:3480)
    at Ft._invokeClientMethod (https://.../_framework/blazor.server.js:1:75072)
    at Ft._processIncomingData (https://.../_framework/blazor.server.js:1:72696)
    at Ft.connection.onreceive (https://..../_framework/blazor.server.js:1:67009)
         at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
         at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
         at Radzen.Blazor.RadzenDatePicker`1.OnAfterRenderAsync(Boolean firstRender)
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET http://.../_content/DevExpress.Blazor/modules/data-qa-utils-8be7c726.js - -
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/_content/DevExpress.Blazor/modules/data-qa-utils-8be7c726.js'. Physical path: 'D:\webroot\wwwroot\....\wwwroot\_content\DevExpress.Blazor\modules\data-qa-utils-8be7c726.js'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET http://.../_content/DevExpress.Blazor/modules/data-qa-utils-8be7c726.js - - - 200 372 text/javascript 1.7801ms
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
      Unhandled exception rendering component: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
      Microsoft.JSInterop.JSDisconnectedException: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
         at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSRuntime.BeginInvokeJS(Int64 asyncHandle, String identifier, String argsJson, JSCallResultType resultType, Int64 targetInstanceId)
         at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, CancellationToken cancellationToken, Object[] args)
         at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
         at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
         at Microsoft.JSInterop.Implementation.JSObjectReference.DisposeAsync()
         at DevExpress.Blazor.Internal.DxBlazorModule.GetDeviceInfoAsync[T](CancellationToken ct, Object[] args)
         at DevExpress.Blazor.Internal.EnvironmentInfoBase.<.ctor>g__InitializeRuntimeStateAsync|1_1(JSRuntimeAccessor runtimeAccessor)
         at DevExpress.Blazor.DxToolbar.InitClientSide(Boolean firstRender)
         at DevExpress.Blazor.Base.DxComponentBase.OnRootRenderAsync(Boolean firstRender)
         at DevExpress.Blazor.Base.DxDecoratedComponent.<OnAfterRenderAsync>g__OnAfterRenderCoreAsync|32_2(DxDecoratedComponent self, Boolean firstRender)
         at DevExpress.Blazor.Base.DxDecoratedComponent.<OnAfterRenderAsync>g__OnInitialAfterRenderAsync|32_0(DxDecoratedComponent self)
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
      Unhandled exception in circuit 'n7ur8iQYsfcrT0R69aafjMIkGiPkG3YXqTXywE2s1YA'.
      Microsoft.JSInterop.JSDisconnectedException: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
         at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSRuntime.BeginInvokeJS(Int64 asyncHandle, String identifier, String argsJson, JSCallResultType resultType, Int64 targetInstanceId)
         at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, CancellationToken cancellationToken, Object[] args)
         at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
         at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
         at Microsoft.JSInterop.Implementation.JSObjectReferen```

Even clearing your browser and application cache?

Yes - it is only on pages with Radzen.createDatePicker

The exception can happen only if there is no such function in the Radzen.Blazor.js. You can inspect your application using your browser developer tools to see what’s the content of this file and why it’s old.

It seems that publish the App with VS 2022 will not copy the current Radzen.Blazor.js to the IIS Remote Server...

Never seen such problems before, Radzen Blazor Studio publish is using exactly the same profiles as Visual Studio.

it is weird - it publish always old version

image

this is an old Radzen Blazor App made with Radzen 2.87.x and upgraded with VS2022 to the latest Blazor Component Versions...

might this be a problem?

What will happen if you publish using Radzen?