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
Happens on 0.6.1. When server function that accepts vector argument is called where it is an empty vector it cause 500 error.
The issue is that the argument doesn't get passed in the http request as
arg: []
but rather ommited completely which makes the server arguments fail to deserialize.
Steps To Reproduce
Steps to reproduce the behavior:
This the minimal code:
use dioxus::prelude::*;fnmain(){
dioxus::launch(App);}#[component]fnApp() -> Element{rsx!{
button {
onclick: move |_| {async move {// This will fail because empty vector is not properly serializedlet result = s_f(vec![]).await;
println!("Result: {:?}", result);}},"Test empty vector"}
button {
onclick: move |_| {async move {// This will work because vector has an itemlet result = s_f(vec!["Hello world".into()]).await;
println!("Result: {:?}", result);}},"Test non-empty vector"}}}#[server(SF)]asyncfns_f(items:Vec<String>) -> Result<String,ServerFnError>{println!("Items: {:?}", items);Ok("Success".into())}
Expected behavior
Screenshots
Environment:
Dioxus version: 0.6.1
Dioxus platform: Web
Browser: Firefox
The text was updated successfully, but these errors were encountered:
Problem
Happens on 0.6.1. When server function that accepts vector argument is called where it is an empty vector it cause 500 error.
The issue is that the argument doesn't get passed in the http request as
but rather ommited completely which makes the server arguments fail to deserialize.
Steps To Reproduce
Steps to reproduce the behavior:
This the minimal code:
Expected behavior
Screenshots
Environment:
The text was updated successfully, but these errors were encountered: