Trying to use serde_json in a csr leptos app #215
-
Hello! async fn send_data(data: String) -> Result<()> {
let dto = DataDto {
data,
};
let json = serde_json::to_string(&dto).unwrap();
reqwasm::http::Request::post("url")
.body(json)
.send()
.await?;
Ok(())
} I keep getting the error:
I don't understand why it complains since serde_json is declared in the edit: Disclaimer I'm new to rust and still getting used the the ecosystem. There is a big chance this has nothing to do with leptos :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I solved it, seems like the |
Beta Was this translation helpful? Give feedback.
I solved it, seems like the
cargo-leptos
crate has other default features than what was set in the Cargo.toml file. But it's finally solved 🎊