thirtyfour icon indicating copy to clipboard operation
thirtyfour copied to clipboard

build error when targetting wasm32-wasip1

Open tuananh opened this issue 8 months ago • 1 comments

I'm getting the following error when targeting wasm32-wasip1

error[E0599]: no function or associated item named `default` found for struct `reqwest::Body` in the current scope                                                                                                              --> /home/anh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/thirtyfour-0.34.0/src/session/http.rs:60:58
   |
60 |             Body::Empty => req = req.body(reqwest::Body::default()),
   |                                                          ^^^^^^^ function or associated item not found in `Body`

error[E0599]: no method named `timeout` found for struct `ClientBuilder` in the current scope
  --> /home/anh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/thirtyfour-0.34.0/src/session/http.rs:86:32
   |
86 |     reqwest::Client::builder().timeout(timeout).build().expect("Failed to create reqwest client")
   |                                ^^^^^^^ method not found in `ClientBuilder`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `thirtyfour` (lib) due to 2 previous errors

ref: https://github.com/Vrtgs/thirtyfour/issues/30

tuananh avatar Apr 21 '25 13:04 tuananh

I know this might be very blame-y but reqwest just doesn't work in wasip1, it uses wasmbindgen to hook into JS, so you should just not use the default reqwest feature and use our own client

vrtgs avatar Jun 12 '25 18:06 vrtgs