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 785 forks source link

Sporadic exception in DataGrid #173

Closed OndrejUzovic closed 3 years ago

OndrejUzovic commented 3 years ago

This is a sporadic and rare exception I get when the DataGrid is being displayed: (my current version 3.6.7)

[2021-07-14T13:45:56.343Z] Error: Microsoft.JSInterop.JSException: Could not find 'Radzen.adjustDataGridHeader' ('Radzen' was undefined).
Error: Could not find 'Radzen.adjustDataGridHeader' ('Radzen' was undefined).
    at https://localhost:44395/_framework/blazor.server.js:1:67388
    at Array.forEach (<anonymous>)
    at e.findFunction (https://localhost:44395/_framework/blazor.server.js:1:67348)
    at b (https://localhost:44395/_framework/blazor.server.js:1:69090)
    at https://localhost:44395/_framework/blazor.server.js:1:70036
    at new Promise (<anonymous>)
    at e.beginInvokeJSFromDotNet (https://localhost:44395/_framework/blazor.server.js:1:70009)
    at https://localhost:44395/_framework/blazor.server.js:1:26293
    at Array.forEach (<anonymous>)
    at e.invokeClientMethod (https://localhost:44395/_framework/blazor.server.js:1:26263)
   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.RadzenGrid`1.OnAfterRenderAsync(Boolean firstRender)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
akorchev commented 3 years ago

This error indicates that the Radzen JS file didn't load for some reason. You can try moving it up before the blazor JS file.

OndrejUzovic commented 3 years ago

This error is really very rare and so far I observed it only on the development machine. Not loading that file seems like an development environment problem - therefore, let's close this issue.