Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove tower service if wasm32 #162

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gusinacio
Copy link

No description provided.

Signed-off-by: Gustavo Inacio <incio.gusta@gmail.com>
@gusinacio gusinacio requested a review from a team as a code owner June 19, 2024 19:09
@eopb
Copy link
Member

eopb commented Oct 16, 2024

Please can you provide more details around what's not working when the target is wasm?

I'd like to understand this before merging. Please also update the changelog.

@podusowski
Copy link

Hi,
I haven't had a change to look at it deeper, but I too got problem with building reqwest-middleware on WASM since 0.3. I suppose I could, and maybe even should just not use reqwest-middleware on WASM as in my case it's for HTTP caching, but I thought you might want to know.

https://github.com/podusowski/walkers/actions/runs/11654418524/job/32447924794?pr=220

@nickguletskii
Copy link

@eopb Without this patch, builds for wasm32-unknown-unknown fail with the following errors:

error[E0599]: no method named `poll_ready` found for struct `Client` in the current scope
   --> reqwest-middleware/src/client.rs:284:24
    |
284 |             self.inner.poll_ready(cx).map_err(crate::Error::Reqwest)
    |                        ^^^^^^^^^^ method not found in `Client`

error[E0599]: no method named `poll_ready` found for reference `&Client` in the current scope
   --> reqwest-middleware/src/client.rs:306:27
    |
306 |             (&self.inner).poll_ready(cx).map_err(crate::Error::Reqwest)
    |                           ^^^^^^^^^^ method not found in `&Client`

error[E0599]: no method named `timeout` found for struct `reqwest::RequestBuilder` in the current scope
   --> reqwest-middleware/src/client.rs:427:31
    |
427 |             inner: self.inner.timeout(timeout),
    |                               ^^^^^^^ method not found in `RequestBuilder`

For more information about this error, try `rustc --explain E0599`.

You can reproduce this issue by running cargo build --target wasm32-unknown-unknown.

@eopb
Copy link
Member

eopb commented Nov 12, 2024

I see. Thanks for the information everyone.

Looking back at the git history, wasm has been somewhat unmaintained in reqwest-middleware for a while. We removed the tests for wasm in #105.

I'd be happy to merge this but ideally, someone should also add back some of tests so that we can ensure that we don't regress this fix in a future change. At the very least we should check in CI that the library builds with the wasm target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants