cargo-web
cargo-web copied to clipboard
cargo web build ignores dependency features
In my Cargo.toml, I have:
reqwest = {version="0.10.1", features = ["blocking", "json"]}
In the Visual Studio Code, compilation is fine, it is not showing errors in my code.
But when I run with cargo web, I get:
no method named
jsonfound for type
reqwest::wasm::response::Response`
It seems that cargo web only compiles the default feature, not the additional ones. How can I add those?
I have the exact same issue. I am trying to use a blocking http request which requires the blocking feature from the reqwest library.
In my Cargo.toml I have:
reqwest = { version = "0.10.4", features = ["json", "blocking"] }
But I still get the following error:
let client = reqwest::blocking::Client::new();
^^^^^^^^ could not find `blocking` in `reqwest`
Any help would be greatly appreciated!