Open sbwalker opened 8 months ago
This! It took me most of the day to figure out that serialization is the issue, when my component wasn't working when I set the parameter to IQueryable data source.
Is there currently a known way to determine the affected class/parameter? Debugging is not possible because the error only occurs on the server, not when I start it from Visual Studio.
This! It took me most of the day to figure out that serialization is the issue, when my component wasn't working when I set the parameter to IQueryable data source.
I spent several days to understand that I'm facing same problem when I use IEnumerable
data source. What I don't understand is why with these collections we have deserialization issues, if according to this article, mentioned collection types are easily (de)serializable. Anyway, as a workaround, I just wrap collections to class and send this class to component.
UPD: Also in my case, when required
requirement was not met, it also calls to log an error in client console.
Is there an existing issue for this?
Describe the bug
If you are transitioning from Static rendering to Interactive rendering and you are passing parameters from one component to another, it is critical that the parameters are serializable. If a parameter is not serializable you will get a cryptic run-time error in the browser console which does not provide any indication of the root cause:
DeserializationRepro.razor
InteractiveComponentWithParameter.razor
MissingConstructor.cs
Running this code will result in a browser console error:
"Error: The list of component operations is not valid."
Note that to resolve this issue you simply need to uncomment the parameterless constructor in the MissingConstructor.cs class
Expected Behavior
Provide an error message which is meaningful and helps a developer identify the source of the problem:
ie. "An error occurred deserializing a component parameter"
Even better would be any reference to the actual component name or parameter name causing the issue.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
8.0.1
Anything else?
No response