radzenhq / radzen-blazor

Radzen Blazor is a set of 90+ free native Blazor UI components packed with DataGrid, Scheduler, Charts and robust theming including Material design and FluentUI.
https://www.radzen.com
MIT License
3.52k stars 786 forks source link

Microsoft.JSInterop.JSException: Could not find 'Radzen.preventArrows after Update to 5.1.1 #1669

Closed Wolfware2023 closed 1 month ago

Wolfware2023 commented 1 month ago

I got a new error in my log after updating to Radzen 5.1.1:

Unhandled exception in circuit '"e5jF1eyakit5n_JsQnIsi_e33j6iIFufBl40s9COH24"'.
Microsoft.JSInterop.JSException: Could not find 'Radzen.preventArrows' ('Radzen' was undefined).
Error: Could not find 'Radzen.preventArrows' ('Radzen' was undefined).
    at https://mydomain.com/myproject/_framework/blazor.server.js:1:497
    at Array.forEach (<anonymous>)
    at i.findFunction (https://mydomain.com/myproject/_framework/blazor.server.js:1:465)
    at E (https://mydomain.com/myproject/_framework/blazor.server.js:1:2606)
    at https://mydomain.com/myproject/_framework/blazor.server.js:1:3494
    at new Promise (<anonymous>)
    at kt.beginInvokeJSFromDotNet (https://mydomain.com/myproject/_framework/blazor.server.js:1:3475)
    at https://mydomain.com/myproject/_framework/blazor.server.js:1:72077
    at Array.forEach (<anonymous>)
    at kt._invokeClientMethod (https://mydomain.com/myproject/_framework/blazor.server.js:1:72063)
   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.RadzenDropDown`1.OnAfterRenderAsync(Boolean firstRender)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState

I was not able to reproduce this error myself yet. Just some of our user got it suddenly. We use Blazor Server on .Net 6. I will update to Radzen 5.1.3 and hope it will solve it.

enchev commented 1 month ago

Clear your browser and application cache

Wolfware2023 commented 1 month ago

It happened to one of the users of the blazor server webservice. If they ask, I can tell them to clear their caches. But from experience our users rarely do. Is there anything, I as the developer could do to fix this for my user(s) without them needing to contact my department?

akorchev commented 1 month ago

You can register the JS file as shown in our documentation. By doing this the cache will invalidate automatically when the version changes.