Issue with FluentUI in Blazor WASM: Deserialization Error on Deployed App
I'm experiencing a deserialization error with FluentUI components in my Blazor WASM web app. The error only occurs on the deployed app (on Azure Static Web App), not in the localhost development environment. I'm using the FluentUI framework 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.
What I've Tried
- Ensured Version Consistency: Verified that the same version of FluentUI is used in both development and production environments.
- Checked Serialization Settings: Made sure that the serialization settings are consistent.
- Deployment Configuration: Double-checked the deployment process to ensure all necessary files and configurations are included.
- Updated FluentUI: Ensured that the latest stable version of FluentUI is being used.
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?