We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfTab crashes app with Arg_InvalidCastException

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)



2 Replies

RM Ruksar Moosa Sait Syncfusion Team November 24, 2022 09:48 AM

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.

 

  • Issue replicating code snippets or
  • Issue reproducing sample.


MK Michael Kanios December 3, 2022 06:21 AM

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:

  1. Add an SfTab in a component which has a link from main menu
  2. After opening the page that has the tab, hit the link to the same page




Loader.
Live Chat Icon For mobile
Up arrow icon