yewstack / yew

Rust / Wasm framework for creating reliable and efficient web applications
https://yew.rs
Apache License 2.0
30.22k stars 1.41k forks source link

the trait bound `implicit_clone::unsync::IMap<_, _>: From<indexmap::IndexMap<K, V>>` is not satisfied #3659

Open brianmay opened 1 month ago

brianmay commented 1 month ago

Problem

I keep getting this error when I try to update a package like serde_yaml or replace serde_yaml with serde_yml line 216.

the trait bound `implicit_clone::unsync::IMap<_, _>: From<indexmap::IndexMap<K, V>>` is not satisfied
the following other types implement trait `From<T>`:
  <implicit_clone::unsync::IMap<K, V> as From<indexmap::map::IndexMap<K, V>>>
  <implicit_clone::unsync::IMap<K, V> as From<std::rc::Rc<indexmap::map::IndexMap<K, V>>>>
  <implicit_clone::unsync::IMap<K, V> as From<&'static [(K, V)]>>

This comes from .../yew-0.21.0/src/html/conversion/into_prop_value.rs

I am somewhat puzzled what is going on here. Perhaps the update of indexmap from 2.0.0 to 2.2.6 changed the API.

Steps To Reproduce

See https://github.com/brianmay/robotica-rust/pull/518

Expected behavior No errors.

Screenshots As above.

Environment:

Questionnaire

somemarco commented 1 month ago

+1 this issue, currently trying out yew with the getting started example per documentation and the same error appears, even if i remove the dynamic/state parts (e.g. only trying to render an h1).

yanickrochon commented 1 month ago

Sane thing. I have tried a few examples, including those in the docs, and the result is always this crash.

Update: this problem does not seem to be there with version 0.20

Update 2: this commit seems to be the problem, no? https://github.com/yewstack/yew/commit/71b0f206a133387381d0dd2cbe8e87c74d9b3638

its-the-shrimp commented 1 month ago

This is a problem with indexmap breaking backwards-compatibility between minor releases, what worked for me was deleting the Cargo.lock in my project.

brianmay commented 1 month ago

Should we report a bug against indexmap then?

Jungle666 commented 1 month ago

anyone solved ?

brianmay commented 1 month ago

Not as far as I am aware. I think somebody needs to open a bug against indexmap.

(I haven't had time recently)

Anybody know what version of indexmap broke backwards compatibility?

pratyushV-l commented 1 month ago

+1 this issue getting this when running the example script in the yew documentation

brianmay commented 1 month ago

Not sure this helps, but I did the following, by adding fake indexmap dependancy:

Huh? I verified in each case using "cargo tree" that the yew/indexmap was the expected version.

Then I did a "cargo update" (no other changes), which updated indexmap to 2.2.6 everywhere. It still seems to work.

So now I am unclear if indexmap 2.2.6 is the solution, or if this is just coincidence. And I haven't been able to test my binary yet (unrelated issue with clippy after updating everything).

its-the-shrimp commented 4 weeks ago

It still fails after reverting the version because Cargo.lock will probably probably hold onto the previously set 2.0.1, since it assumes that going from 2.0.0 to 2.0.1 shouldn't be breaking

brianmay commented 4 weeks ago

Thats what I thought too, but "cargo tree" clearly showed the yew -> indexmap dependency was now on 2.0.0.

cecton commented 2 weeks ago

+1 this issue, currently trying out yew with the getting started example per documentation and the same error appears, even if i remove the dynamic/state parts (e.g. only trying to render an h1).

Hi everyone! :wave: I would like to collect more feedbacks for https://github.com/yewstack/implicit-clone/pull/51

I tried the example you mentioned here by doing this:

cargo generate --git https://github.com/yewstack/yew-trunk-minimal-template
trunk serve

Everything seems to be working fine. I couldn't reproduce it. Can anyone give more details or exact steps on how to reproduce it?