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

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

Open
1 of 3 tasks
brianmay opened this issue May 9, 2024 · 12 comments
Labels

Comments

@brianmay
Copy link

brianmay commented May 9, 2024

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 brianmay/robotica-rust#518

Expected behavior
No errors.

Screenshots
As above.

Environment:

  • Yew version: 0.21.0
  • Rust version: 1.78.0
  • Target, if relevant: wasm32-unknown-unknown
  • Build tool, if relevant: wasm-pack
  • OS, if relevant: Linux

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later
@brianmay brianmay added the bug label May 9, 2024
@somemarco
Copy link

+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
Copy link

yanickrochon commented May 11, 2024

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? 71b0f20

@its-the-shrimp
Copy link
Contributor

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
Copy link
Author

Should we report a bug against indexmap then?

@Jungle666
Copy link

anyone solved ?

@brianmay
Copy link
Author

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
Copy link

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

@brianmay
Copy link
Author

brianmay commented Jun 3, 2024

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

  • Upgraded indexmap to 2.0.0 - it works.
  • Upgraded indexmap to 2.0.1 - it fails.
  • Downgraded indexmap to 2.0.0 - it still fails. What?
  • Revert all changes - it works.

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
Copy link
Contributor

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
Copy link
Author

brianmay commented Jun 3, 2024

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

@cecton
Copy link
Member

cecton commented Jun 17, 2024

+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! 👋 I would like to collect more feedbacks for yewstack/implicit-clone#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?

@brianmay
Copy link
Author

brianmay commented Jul 7, 2024

Here is a more direct link to the error when I did get it: https://github.com/brianmay/robotica-rust/actions/runs/9261430510/job/25476776874

My project has changed a bit since this problem; I am no longer getting the error. But if I check out the old version, and apply the same change, I get the problem again:

git clone https://github.com/brianmay/robotica-rust.git
git checkout 7e024ee
wget https://patch-diff.githubusercontent.com/raw/brianmay/robotica-rust/pull/518.patch
patch -p1 --dry-run < 518.patch
cargo build -p robotica-frontend --target wasm32-unknown-unknown

This gives me the following (note I have direnv+nix configured to install rust; you probably won't see these messages).

at 16:42:05 ❯ git checkout 7e024ee
Previous HEAD position was cebb443 Update flakes
HEAD is now at 7e024ee Add NotifyFullStatus to shelly (2)
direnv: loading ~/tree/personal/robotica/robotica-rust/.envrc
direnv: using flake . --impure
[1/0/1 copied (56.1/148.7 MiB), 9.6/24.7 MiB DL] fetching source from https://cache.nixos.orgdirenv: ([/nix/store/81cqmrlp1x77139nsx0s5jjqk6jxxxxw-direnv-2.34.0/bin/direnv export zsh]) is taking a while to execute. Use CTRL-C to give up.
direnv: nix-direnv: Renewed cache
direnv: export +AR +AR_FOR_BUILD +AS +AS_FOR_BUILD +CC +CC_FOR_BUILD +CONFIG_FILE +CONFIG_SHELL +CXX +CXX_FOR_BUILD +DATABASE_URL +DEVENV_DOTFILE +DEVENV_PROFILE +DEVENV_ROOT +DEVENV_RUNTIME +DEVENV_STATE +IN_NIX_SHELL +LD +LD_FOR_BUILD +NIX_BINTOOLS +NIX_BINTOOLS_FOR_BUILD +NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CC +NIX_CC_FOR_BUILD +NIX_CC_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_CFLAGS_COMPILE_FOR_BUILD +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_LDFLAGS +NIX_LDFLAGS_FOR_BUILD +NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_STORE +NM +NM_FOR_BUILD +NODE_PATH +OBJCOPY +OBJCOPY_FOR_BUILD +OBJDUMP +OBJDUMP_FOR_BUILD +PGDATA +PGHOST +PGPORT +PKG_CONFIG +PKG_CONFIG_PATH +PYTHONPATH +RANLIB +RANLIB_FOR_BUILD +READELF +READELF_FOR_BUILD +ROBOTICA_DEBUG +SIZE +SIZE_FOR_BUILD +SLINT_CONFIG_FILE +SOURCE_DATE_EPOCH +STATIC_PATH +STRINGS +STRINGS_FOR_BUILD +STRIP +STRIP_FOR_BUILD +cmakeFlags +configureFlags +mesonFlags +name +system ~PATH ~XDG_DATA_DIRS

at 16:46:07 ❯ patch -p1 --dry-run < 518.patch
checking file Cargo.lock
checking file brian-backend/Cargo.toml
checking file freeswitch/Cargo.toml
checking file robotica-backend/Cargo.toml
Hunk #1 succeeded at 16 with fuzz 1.
checking file robotica-slint/Cargo.toml

at 16:46:17 ❯ patch -p1  < 518.patch
patching file Cargo.lock
patching file brian-backend/Cargo.toml
patching file freeswitch/Cargo.toml
patching file robotica-backend/Cargo.toml
Hunk #1 succeeded at 16 with fuzz 1.
patching file robotica-slint/Cargo.toml

at 16:46:21 ❯ cargo build -p robotica-backend
    Blocking waiting for file lock on build directory
   Compiling tracing v0.1.40
   Compiling hashbrown v0.14.5
   Compiling want v0.3.0
   Compiling native-tls v0.2.11
   Compiling ena v0.14.2
   Compiling rustls v0.21.7
   Compiling tungstenite v0.21.0
   Compiling wkt v0.10.3
   Compiling geo v0.28.0
   Compiling tokio-util v0.7.7
   Compiling axum-core v0.4.3
   Compiling tower v0.4.13
   Compiling lalrpop v0.20.2
   Compiling tokio-native-tls v0.3.1
   Compiling tokio-tungstenite v0.21.0
   Compiling indexmap v2.2.6
   Compiling hashlink v0.8.4
   Compiling tower-http v0.5.2
   Compiling serde_json v1.0.112
   Compiling h2 v0.4.3
   Compiling h2 v0.3.24
   Compiling serde_yaml v0.9.34+deprecated
   Compiling sqlx-core v0.7.4
   Compiling tokio-rustls v0.24.1
   Compiling geojson v0.24.1
   Compiling validator v0.16.0
   Compiling biscuit v0.6.0
   Compiling rumqttc v0.23.0
   Compiling tower-sessions-core v0.12.2
   Compiling tower-cookies v0.10.0
   Compiling maud v0.26.0
   Compiling robotica-common v0.1.0 (/home/brian/tree/personal/robotica/robotica-rust/robotica-common)
   Compiling tower-sessions-memory-store v0.12.2
   Compiling tower-sessions v0.12.2
   Compiling sqlx-postgres v0.7.4
   Compiling hyper v1.3.1
   Compiling hyper v0.14.25
   Compiling hyper-util v0.1.3
   Compiling sqlx-macros-core v0.7.4
   Compiling hyper-tls v0.6.0
   Compiling axum v0.7.5
   Compiling robotica-backend v0.1.0 (/home/brian/tree/personal/robotica/robotica-rust/robotica-backend)
   Compiling reqwest v0.12.4
   Compiling sqlx-macros v0.7.4
   Compiling hyper-tls v0.5.0
   Compiling reqwest v0.11.27
   Compiling openid v0.13.0
   Compiling sqlx v0.7.4
   Compiling tower-sessions-sqlx-store v0.12.0
   Compiling geozero v0.13.0
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 14.60s

at 16:46:41 ❯ cargo build -p robotica-frontend --target wasm32-unknown-unknown
    Blocking waiting for file lock on build directory
   Compiling indexmap v2.2.6
   Compiling robotica-common v0.1.0 (/home/brian/tree/personal/robotica/robotica-rust/robotica-common)
   Compiling yew v0.21.0
error[E0277]: the trait bound `implicit_clone::unsync::IMap<_, _>: From<indexmap::IndexMap<K, V>>` is not satisfied
   --> /home/brian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/yew-0.21.0/src/html/conversion/into_prop_value.rs:216:9
    |
216 |         IMap::from(self)
    |         ^^^^ the trait `From<indexmap::IndexMap<K, V>>` is not implemented for `implicit_clone::unsync::IMap<_, _>`
    |
    = help: 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)]>>

For more information about this error, try `rustc --explain E0277`.
error: could not compile `yew` (lib) due to 1 previous error

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

No branches or pull requests

7 participants