emilk / ehttp

Minimal Rust HTTP client for both native and WASM
Apache License 2.0
323 stars 30 forks source link

ehttp is not passing the `console` feature to `web-sys` #40

Closed kekonn closed 10 months ago

kekonn commented 10 months ago

I have a library crate to which I'm trying to add unit tests. The crate builds just fine using trunk and runs when used in a project, but when I try to build the tests (cargo build --tests --target wasm32-unknown-unknown) I get the following error:

  --> C:\Users\jonas.vanderaa\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ehttp-0.3.1\src\web.rs:34:22
   |
34 |             web_sys::console::error_1(&value);
   |                      ^^^^^^^ could not find `console` in `web_sys`

Any idea what's causing this?

emilk commented 10 months ago

I think "console" is missing from the web-sys features of ehttp:

https://github.com/emilk/ehttp/blob/b5e2da0d9c57ee92a9b8db5e8a2a3f38652aba52/ehttp/Cargo.toml#L52-L61