Dashboard Layout Error: System.ArgumentNullException: Value cannot be null. (Parameter 'json')

warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]

      Unhandled exception rendering component: Value cannot be null. (Parameter 'json')

      System.ArgumentNullException: Value cannot be null. (Parameter 'json')

         at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)

         at Syncfusion.Blazor.Layouts.SfDashboardLayout.Initialize()

         at Syncfusion.Blazor.Layouts.SfDashboardLayout.OnAfterScriptRendered()

         at Syncfusion.Blazor.SfBaseComponent.OnAfterRenderAsync(Boolean firstRender)

         at Syncfusion.Blazor.Layouts.SfDashboardLayout.OnAfterRenderAsync(Boolean firstRender)

         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]

      Unhandled exception in circuit 'VN85yIGF_51B8TxbvjJYVpJU6kTupDdzU2BRby32PDo'.

      System.ArgumentNullException: Value cannot be null. (Parameter 'json')

         at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)

         at Syncfusion.Blazor.Layouts.SfDashboardLayout.Initialize()

         at Syncfusion.Blazor.Layouts.SfDashboardLayout.OnAfterScriptRendered()

         at Syncfusion.Blazor.SfBaseComponent.OnAfterRenderAsync(Boolean firstRender)

         at Syncfusion.Blazor.Layouts.SfDashboardLayout.OnAfterRenderAsync(Boolean firstRender)

         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)



3 Replies

IL Indhumathy Loganathan Syncfusion Team April 15, 2022 08:07 AM UTC

Hi Aitana,


Greetings from Syncfusion support.


In our recent release, we included some of the breaking changes in Blazor to improve performance over the JavaScript isolation approach. The reported issue at your end occurs due to this. Please check the below release notes for changes.


Release notes link : https://blazor.syncfusion.com/documentation/release-notes/20.1.47?type=all#common


To overcome the issue follow one of the below way.


Way 1: Load scripts externally via CDN.


<script src=https://cdn.syncfusion.com/blazor/20.1.47/syncfusion-blazor.min.js type="text/javascript"></script>


Way 2: Set IgnoreScriptIsolation as false in AddSyncfusionBlazor().


builder.Services.AddSyncfusionBlazor(options => { options.IgnoreScriptIsolation = false; });


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/DASHBO~21643078434


Please check the attached sample and get back to us if you need any further assistance. 


Regards,

Indhumathy L



BS Boden Smith July 19, 2022 01:51 AM UTC

I am receiving the same error when rendering the dashboard component, but neither of these fixes have worked for me. Any suggestions?




IL Indhumathy Loganathan Syncfusion Team July 19, 2022 08:53 AM UTC

Hi Boden,


We understand that you are facing the error at your end. But the reported error only occurs due to the breaking changes and you can avoid them by modifying the previous mentioned changes. Please map the script and style references in your sample


<link rel='nofollow' href=https://cdn.syncfusion.com/blazor/20.2.38/styles/bootstrap5.css rel="stylesheet"/>

<script src=https://cdn.syncfusion.com/blazor/20.2.38/syncfusion-blazor.min.js type="text/javascript"></script>


For your reference, we have updated the sample in latest version. Please find the sample from below link.


https://www.syncfusion.com/downloads/support/directtrac/general/ze/DashboardScriptError-797952050


Kindly compare the shared sample at your end. If issue still persists, revert us with a simple issue replicated sample which would help as assist you promptly. Also, we suggest you clear the cache by following the below way.


https://www.syncfusion.com/kb/6987/how-to-clear-nuget-cache


Please get back to us if you need any further assistance.


Regards,

Indhumathy L


Loader.
Up arrow icon