Hi,
We have users reporting the following critical error which crashes our app (Blazor WASM with AOT) periodically.
It appears to be coming from the SfTab component, but we are unable to figure out what the problem might be.
Please advise, thanks John
blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Arg_InvalidCastException
System.InvalidCastException: Arg_InvalidCastException
at System.Object.CssClassGetter(Object)
at System.Text.Json.Serialization.JsonConverter`1[[System.Collections.Generic.List`1[[Syncfusion.Blazor.Navigations.TabItem, Syncfusion.Blazor.Navigations, Version = 20.3.0.57, Culture = neutral, PublicKeyToken = null]], System.Private.CoreLib, Version = 7.0.0.0, Culture = neutral, PublicKeyToken = 7cec85d7bea7798e]].WriteCore(Utf8JsonWriter, List`1 & , JsonSerializerOptions, WriteStack & )
at System.Text.Json.JsonSerializer.WriteString[List`1](List`1 & , JsonTypeInfo`1)
at Syncfusion.Blazor.Navigations.SfTab.OnParametersSetAsync()
at System.Object.CssClassGetter(Object)
at System.Text.Json.Serialization.JsonConverter`1[[System.Collections.Generic.List`1[[Syncfusion.Blazor.Navigations.TabItem, Syncfusion.Blazor.Navigations, Version = 20.3.0.57, Culture = neutral, PublicKeyToken = null]], System.Private.CoreLib, Version = 7.0.0.0, Culture = neutral, PublicKeyToken = 7cec85d7bea7798e]].WriteCore(Utf8JsonWriter, List`1 & , JsonSerializerOptions, WriteStack & )
at System.Text.Json.JsonSerializer.WriteString[List`1](List`1 & , JsonTypeInfo`1)
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
Hi John,
We looked into the issue you reported, but we still require more details to fully analyze it and provide an appropriate solution.
Please share the details below.
Hi Ruksar,
I'm getting the same error. I believe it has to do with AOT as I'm getting this error only on release with AOT...
To reproduce the error:
Michael, We have prepared a sample with AOT and checked the reported issue in the hosting(release) but unfortunately we could not reproduce the issue at our end. We require the below details to proceed further.
Hi Ruksar,
After careful investigation, it seems the issue is not related to Syncfusion as I'm getting this error for different components in the app. It seems the same with the one reported here:
I'm getting the same for SfGrid as well.
I managed to get this only at release with AOT, and it happens some times after you immediately click on another menu item that redirects to a different component or even the same component.
If I manage to get more information, I'll share it here, or the dotnet Github repo if it's more relevant.
Below you can find the same error with SfGrid if that matters.
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Arg_InvalidCastException
System.InvalidCastException: Arg_InvalidCastException
at System.Object.TableWidthGetter(Object )
at System.Text.Json.Serialization.JsonConverter`1[[System.Collections.Generic.IDictionary`2[[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].WriteCore(Utf8JsonWriter , IDictionary`2& , JsonSerializerOptions , WriteStack& )
at System.Text.Json.JsonSerializer.WriteString[IDictionary`2](IDictionary`2& , JsonTypeInfo`1 )
at Syncfusion.Blazor.Grids.SfGrid`1.
We were unable to replicate the issue at our end. We have prepared a NET7 AOT enabled Blazor WebAssembly application which you can download from the below link.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/WasmNet7600100399
We have provided compatibility support for NET7 from the Volume 3 2022 release ( version: 20.3.47) and are able to render controls without any issues. If the issue persists, share the below details to validate further.