I’m experiencing a deserialization error with FluentUI components in my Blazor WASM web app. The error only occurs on the deployed app (using Azure Static Web App), not in the localhost development environment. I’m using the FluentUI framework of Microsoft for UI components, and the error message in the browser console is as follows:
Uncaught (in promise) Error: System.InvalidOperationException: There was an error parsing the event arguments. EventId: '30'.
---> System.NotSupportedException: DeserializeNoConstructor, JsonConstructorAttribute, Microsoft.FluentUI.AspNetCore.Components.AccordionChangeEventArgs Path: $ | LineNumber: 0 | BytePositionInLine: 1.
---> System.NotSupportedException: DeserializeNoConstructor, JsonConstructorAttribute, Microsoft.FluentUI.AspNetCore.Components.AccordionChangeEventArgs
Exception_EndOfInnerExceptionStack
at System.Text.Json.ThrowHelper.ThrowNotSupportedException(ReadStack& , Utf8JsonReader& , NotSupportedException )
at System.Text.Json.ThrowHelper.ThrowNotSupportedException_DeserializeNoConstructor(Type , Utf8JsonReader& , ReadStack& )
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1[[Microsoft.FluentUI.AspNetCore.Components.AccordionChangeEventArgs, Microsoft.FluentUI.AspNetCore.Components, Version=4.7.1.24114, Culture=neutral, PublicKeyToken=null]].OnTryRead(Utf8JsonReader& , Type , JsonSerializerOptions , ReadStack& , AccordionChangeEventArgs& )
This error seems to appear when the app tries to render a FluentUI component.
Environment Details
- Development Environment: Works fine without any errors.
- Production Environment: Throws the deserialization error mentioned above.
How can I resolve the deserialization error related to AccordionChangeEventArgs in my Blazor WASM web app when using FluentUI components? Has anyone faced a similar issue and found a solution or workaround?
I’ve tried verified that the same latest version of FluentUI is used in both development and production environments.