You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[component]fnHome() -> Element{let global_filter:Signal<GlobalFilter> = use_signal(|| GlobalFilter::default());rsx!{
button {
onclick: move |_| {let filter:GlobalFilter = global_filter.read_unchecked().to_owned();async move {
get_server_data(filter).await;}},"Button"}}}#[derive(Clone,Debug,Default,Deserialize,PartialEq,Serialize)]pubstructGlobalFilter{pubtest_string:String,pubtest_vec:Vec<String>,pubtest_hashset:HashSet<String>,pubtest_hashmap:HashMap<String,String>,// wrap them in Option to bypass the bug// pub test_vec: Option<Vec<String>>,// pub test_hashset: Option<HashSet<String>>,// pub test_hashmap: Option<HashMap<String, String>>,}#[server]asyncfnget_server_data(global_filter:GlobalFilter) -> Result<(),ServerFnError>{Ok(())}
After clicking the button, an error( can be observed in browser's dev tool)
Args|missing field `test_vec`
happened. This error happened both on 0.5 and the main branch.
After digging on discord, the tmp solution is to wrap those fields in an Option. Evan mentioned it should be fixed in #2288 but looks like the above case is not covered.
Expected behavior
Those fields in the struct should work without the extra Option
Environment:
Dioxus version: 0.5 and main
Rust version: 1.79
OS info: Debian 12
App platform: Fullstack
The text was updated successfully, but these errors were encountered:
The default server function encoding is post url which doesn't support nested types. You can set the input and output encoding manually with this syntax:
Problem
Steps To Reproduce
Reproducile repo
After clicking the button, an error( can be observed in browser's dev tool)
happened. This error happened both on 0.5 and the main branch.
After digging on discord, the tmp solution is to wrap those fields in an Option. Evan mentioned it should be fixed in #2288 but looks like the above case is not covered.
Expected behavior
Those fields in the struct should work without the extra Option
Environment:
The text was updated successfully, but these errors were encountered: