Skip to content

Fairly random errors when compiling to wasm32-unknown-unknown target. #4

@maltalef101

Description

@maltalef101

I use WASM on the browser and when compiling I get some errors that really seem to come out of nowhere.

When bulding exactly the same crate with cargo build --target x86_64-unknown-linux-gnu the before mentioned errors magically disappear.

These are the bastards:

error[E0432]: unresolved import `reqwest::redirect`
  --> /home/maltalef/.local/share/cargo/registry/src/github.com/jmap-client-0.2.0/src/client.rs:24:5
   |
24 |     redirect,
   |     ^^^^^^^^ no `redirect` in the root

error[E0599]: no method named `timeout` found for struct `ClientBuilder` in the current scope
  --> /home/maltalef/.local/share/cargo/registry/src/github.com/jmap-client-0.2.0/src/blob/download.rs:53:18
   |
53 |                 .timeout(Duration::from_millis(self.timeout()))
   |                  ^^^^^^^ method not found in `ClientBuilder`

error[E0599]: no method named `redirect` found for struct `ClientBuilder` in the current scope
   --> /home/maltalef/.local/share/cargo/registry/src/github.com/jmap-client-0.2.0/src/client.rs:369:22
    |
369 |                     .redirect(self.redirect_policy())
    |                      ^^^^^^^^ method not found in `ClientBuilder`

error[E0599]: no method named `timeout` found for struct `ClientBuilder` in the current scope
  --> /home/maltalef/.local/share/cargo/registry/src/github.com/jmap-client-0.2.0/src/blob/upload.rs:62:22
   |
62 |                     .timeout(Duration::from_millis(self.timeout()))
   |                      ^^^^^^^ method not found in `ClientBuilder`

error[E0599]: no method named `timeout` found for struct `ClientBuilder` in the current scope
   --> /home/maltalef/.local/share/cargo/registry/src/github.com/jmap-client-0.2.0/src/client.rs:147:22
    |
147 |                     .timeout(Duration::from_millis(self.timeout))
    |                      ^^^^^^^ method not found in `ClientBuilder`

error[E0599]: no method named `timeout` found for struct `ClientBuilder` in the current scope
   --> /home/maltalef/.local/share/cargo/registry/src/github.com/jmap-client-0.2.0/src/client.rs:421:22
    |
421 |                     .timeout(Duration::from_millis(DEFAULT_TIMEOUT_MS))
    |                      ^^^^^^^ method not found in `ClientBuilder`

error[E0599]: no method named `connect_timeout` found for struct `ClientBuilder` in the current scope
  --> /home/maltalef/.local/share/cargo/registry/src/github.com/jmap-client-0.2.0/src/event_source/stream.rs:76:18
   |
76 |                 .connect_timeout(Duration::from_millis(self.timeout()))
   |                  ^^^^^^^^^^^^^^^ method not found in `ClientBuilder`

error[E0599]: no method named `bytes_stream` found for struct `Response` in the current scope
  --> /home/maltalef/.local/share/cargo/registry/src/github.com/jmap-client-0.2.0/src/event_source/stream.rs:85:10
   |
85 |         .bytes_stream();
   |          ^^^^^^^^^^^^ method not found in `Response`

If I recall correctly, reqwest added support for WASM some time ago, so I don't have any idea about what is causing the first error. I've found all those unresolved modules locally by exploring the local library clones.

In general, I suspect I've thrown sonething at this library for which it wasn't prepared for. I am really lost in this issue.

Any help is greatly appreciated.
Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions