Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
If I use Breadcrumb-Items with a template instead of text- and icon-attributes, invoking StateHasChanged will throw an Exception.
Here is a minimal excerpt to illustrate the problem:
<button@onclick="(ev) => StateHasChanged()">Destroy</button>
<SfBreadcrumb>
<BreadcrumbItems>
<BreadcrumbItemText="this works"></BreadcrumbItem>
<BreadcrumbItem>
<div>
<span>@(DateTime.Now.ToLongTimeString())</span>
invoking StateHasChanged will throw Exception thanks to this RenderFragment
</div>
</BreadcrumbItem>
<BreadcrumbItemText="also works"></BreadcrumbItem>
</BreadcrumbItems>
</SfBreadcrumb>
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Serialization and deserialization of 'Microsoft.AspNetCore.Components.RenderFragment' instances is not supported. Path: $.ChildContent. System.NotSupportedException: Serialization and deserialization of 'Microsoft.AspNetCore.Components.RenderFragment' instances is not supported. Path: $.ChildContent. ---> System.NotSupportedException: Serialization and deserialization of 'Microsoft.AspNetCore.Components.RenderFragment' instances is not supported. at System.Text.Json.Serialization.Converters.UnsupportedTypeConverter`1[[Microsoft.AspNetCore.Components.RenderFragment, Microsoft.AspNetCore.Components, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].Write(Utf8JsonWriter writer, RenderFragment value, JsonSerializerOptions options) at System.Text.Json.Serialization.JsonConverter`1[[Microsoft.AspNetCore.Components.RenderFragment, Microsoft.AspNetCore.Components, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].TryWrite(Utf8JsonWriter writer, RenderFragment& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1[[Microsoft.AspNetCore.Components.RenderFragment, Microsoft.AspNetCore.Components, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1[[Syncfusion.Blazor.Navigations.BreadcrumbItem, Syncfusion.Blazor.Navigations, Version=25.1.41.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89]].OnTryWrite(Utf8JsonWriter writer, BreadcrumbItem value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter`1[[Syncfusion.Blazor.Navigations.BreadcrumbItem, Syncfusion.Blazor.Navigations, Version=25.1.41.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89]].TryWrite(Utf8JsonWriter writer, BreadcrumbItem& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Converters.ListOfTConverter`2[[System.Collections.Generic.List`1[[Syncfusion.Blazor.Navigations.BreadcrumbItem, Syncfusion.Blazor.Navigations, Version=25.1.41.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Syncfusion.Blazor.Navigations.BreadcrumbItem, Syncfusion.Blazor.Navigations, Version=25.1.41.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89]].OnWriteResume(Utf8JsonWriter writer, List`1 value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonCollectionConverter`2[[System.Collections.Generic.List`1[[Syncfusion.Blazor.Navigations.BreadcrumbItem, Syncfusion.Blazor.Navigations, Version=25.1.41.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Syncfusion.Blazor.Navigations.BreadcrumbItem, Syncfusion.Blazor.Navigations, Version=25.1.41.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89]].OnTryWrite(Utf8JsonWriter writer, List`1 value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter`1[[System.Collections.Generic.List`1[[Syncfusion.Blazor.Navigations.BreadcrumbItem, Syncfusion.Blazor.Navigations, Version=25.1.41.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TryWrite(Utf8JsonWriter writer, List`1& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter`1[[System.Collections.Generic.List`1[[Syncfusion.Blazor.Navigations.BreadcrumbItem, Syncfusion.Blazor.Navigations, Version=25.1.41.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].WriteCore(Utf8JsonWriter writer, List`1& value, JsonSerializerOptions options, WriteStack& state) --- End of inner exception stack trace --- at System.Text.Json.ThrowHelper.ThrowNotSupportedException(WriteStack& state, NotSupportedException ex) at System.Text.Json.Serialization.JsonConverter`1[[System.Collections.Generic.List`1[[Syncfusion.Blazor.Navigations.BreadcrumbItem, Syncfusion.Blazor.Navigations, Version=25.1.41.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].WriteCore(Utf8JsonWriter writer, List`1& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1[[System.Collections.Generic.List`1[[Syncfusion.Blazor.Navigations.BreadcrumbItem, Syncfusion.Blazor.Navigations, Version=25.1.41.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Serialize(Utf8JsonWriter writer, List`1& rootValue, Object rootValueBoxed) at System.Text.Json.JsonSerializer.WriteString[List`1](List`1& value, JsonTypeInfo`1 jsonTypeInfo) at System.Text.Json.JsonSerializer.Serialize[List`1](List`1 value, JsonSerializerOptions options) at Syncfusion.Blazor.Internal.SfBaseUtils.Equals[List`1](List`1 oldValue, List`1 newValue) at Syncfusion.Blazor.SfBaseComponent.NotifyPropertyChanges[List`1](String propertyName, List`1 publicValue, List`1 privateValue, Boolean updatePrevProps) at Syncfusion.Blazor.SfBaseComponent.NotifyPropertyChanges[List`1](String propertyName, List`1 publicValue, List`1 privateValue) at Syncfusion.Blazor.Navigations.SfBreadcrumb.OnParametersSetAsync() at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
This seems to be a Problem with 25.*-versions. If I downgrade to 24.1.*, the Error dissappears and everthing works as it should.
Just a guess: I think, the JsonIgnore-Attribute at Children-RenderFragments are missing in the BreadCrumb(Item)-Controls.
If I'm guessing right: Will this be fixed? Can you provide a rough time-/version frame (rather in the weekly releases or in the next major release)?
Otherwise: Is there a workaround apart from not using StateHasChanges?