Cannot pass the parameter 'X' to component 'Y' with rendermode 'InteractiveServerRenderMode'
If in a .NET 8 or .NET 9 application, an interactive child component takes a non-serializable parameter, such as a render fragment, the following exception is raised:
Cannot pass the parameter ‘X’ to component ‘Y’ with rendermode ‘InteractiveServerRenderMode’. This is because the parameter is of the delegate type ‘Microsoft.AspNetCore.Components.RenderFragment’, which is arbitrary code and cannot be serialized.
This exception can be raised for InteractiveServerRenderMode, InteractiveWasmRenderMode, and InteractiveAutoRenderMode. Refer to the following topic for more information: Child component with a serializable parameter.
To solve this issue, enable interactive render mode for a parent component that has serializable parameters only or make the entire page interactive. Refer to the following topic for more details: Enable Interactive Render Mode.