I am trying to use Stylist version 0.12.1 in Rust/Yew. When I build the project using Cargo build, every thing compiles without any errors.
The crate that I have n Cargo.toml looks like: stylist = { version = "0.12.1", features = ["yew"] }
However, when I use trunk serve I get the following errors:
error[E0308]: mismatched types
--> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stylist-0.12.1/src/manager/mod.rs:244:38
|
244 | .map_err(|e| Error::Web(Some(e)))
| ---- ^ expected `()`, found `JsValue`
| |
| arguments to this enum variant are incorrect
|
help: the type constructed contains `JsValue` due to the type of the argument passed
--> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stylist-0.12.1/src/manager/mod.rs:244:33
|
244 | .map_err(|e| Error::Web(Some(e)))
| ^^^^^-^
| |
| this argument influences the type of `Some`
note: tuple variant defined here
--> /home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:571:5
|
571 | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
| ^^^^
error[E0277]: `?` couldn't convert the error to `()`
--> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stylist-0.12.1/src/manager/mod.rs:255:91
|
255 | if let Some(m) = document.query_selector(&format!("style[data-style={}]", id))? {
| ^ the trait `From<JsValue>` is not implemented for `()`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following other types implement trait `From<T>`:
<(T, T) as From<[T; 2]>>
<(T, T, T) as From<[T; 3]>>
<(T, T, T, T) as From<[T; 4]>>
<(T, T, T, T, T) as From<[T; 5]>>
<(T, T, T, T, T, T) as From<[T; 6]>>
<(T, T, T, T, T, T, T) as From<[T; 7]>>
<(T, T, T, T, T, T, T, T) as From<[T; 8]>>
<(T, T, T, T, T, T, T, T, T) as From<[T; 9]>>
and 4 others
= note: required for `Result<(), ()>` to implement `FromResidual<Result<Infallible, JsValue>>`
error[E0277]: `?` couldn't convert the error to `()`
--> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stylist-0.12.1/src/manager/mod.rs:257:44
|
257 | parent.remove_child(&m)?;
| ^ the trait `From<JsValue>` is not implemented for `()`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the following other types implement trait `From<T>`:
<(T, T) as From<[T; 2]>>
<(T, T, T) as From<[T; 3]>>
<(T, T, T, T) as From<[T; 4]>>
<(T, T, T, T, T) as From<[T; 5]>>
<(T, T, T, T, T, T) as From<[T; 6]>>
<(T, T, T, T, T, T, T) as From<[T; 7]>>
<(T, T, T, T, T, T, T, T) as From<[T; 8]>>
<(T, T, T, T, T, T, T, T, T) as From<[T; 9]>>
and 4 others
= note: required for `Result<(), ()>` to implement `FromResidual<Result<Infallible, JsValue>>`
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `stylist` (lib) due to 3 previous errors
2023-09-12T21:39:07.427662Z ERROR ❌ error
error from HTML pipeline
The output of rustc -vV, cargo -vV and trunk -vV are:
I am trying to use Stylist version 0.12.1 in Rust/Yew. When I build the project using Cargo build, every thing compiles without any errors.
The crate that I have n Cargo.toml looks like: stylist = { version = "0.12.1", features = ["yew"] }
However, when I use trunk serve I get the following errors:
The output of rustc -vV, cargo -vV and trunk -vV are:
The problem can be reproduced by running the following in bash:
The issue can also be found at: https://stackoverflow.com/questions/77092890/unable-to-use-stylist-0-12-1-using-trunk-serve