diff --git a/sdk/core/src/http_client/reqwest.rs b/sdk/core/src/http_client/reqwest.rs index 617fa5d73d..2b40f09dd1 100644 --- a/sdk/core/src/http_client/reqwest.rs +++ b/sdk/core/src/http_client/reqwest.rs @@ -14,10 +14,18 @@ pub fn new_reqwest_client() -> Arc { // `hyper` library that causes the `reqwest` client to hang in some cases. // // See for more details. + #[cfg(not(target_arch = "wasm32"))] let client = ::reqwest::ClientBuilder::new() .pool_max_idle_per_host(0) .build() .expect("failed to build `reqwest` client"); + + // `reqwest` does not implement `pool_max_idle_per_host()` on WASM. + #[cfg(target_arch = "wasm32")] + let client = ::reqwest::ClientBuilder::new() + .build() + .expect("failed to build `reqwest` client"); + Arc::new(client) }