Mismatch in deps

Guys, I'm getting:

error: failed to select a version for wasm-bindgen-shared.
... required by package wasm-bindgen-macro-support v0.2.89 ... which satisfies dependency wasm-bindgen-macro-support = "=0.2.89"of packagewasm-bindgen-macro v0.2.89 ... which satisfies dependencywasm-bindgen-macro = "=0.2.89"of packagewasm-bindgen v0.2.89 ... which satisfies dependencywasm-bindgen = "^0.2.89"of packagereqwest v0.12.12 ... which satisfies dependencyreqwest = "^0.12.12"of packagegcp-bigquery-client v0.26.0 ... which satisfies dependencygcp-bigquery-client = "^0.26.0"of packagemy_app v0.1.0 (/path_to/my_app)versions that meet the requirements=0.2.89` are: 0.2.89

the package wasm-bindgen-shared links to the native library wasm_bindgen, but it conflicts with a previous package which links to wasm_bindgen as well:
package wasm-bindgen-shared v0.2.100
... which satisfies dependency wasm-bindgen-shared = "=0.2.100" (locked to 0.2.100) of package wasm-bindgen-macro-support v0.2.100
... which satisfies dependency wasm-bindgen-macro-support = "=0.2.100" (locked to 0.2.100) of package wasm-bindgen-macro v0.2.100
... which satisfies dependency wasm-bindgen-macro = "=0.2.100" (locked to 0.2.100) of package wasm-bindgen v0.2.100
... which satisfies dependency wasm-bindgen = "^0.2" (locked to 0.2.100) of package chrono v0.4.41
... which satisfies dependency chrono = "^0.4.41" (locked to 0.4.41) of package my_app v0.1.0 (/path_to/my_app)
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the links = "wasm_bindgen" value. For more information, see Dependency Resolution - The Cargo Book.

I've tried to read the Dependency Resolution in Cargo Book as the link suggests but failed at solving the problem.
From what I understand there are two crates chrono and gcp-bigquery-client that have dependencies on wasm-bindgen but different versions of it.

OK, the solution is to enforce specific version. In Cargo.toml:

[patch.crates-io]
wasm-bindgen = "=0.2.100"

Can't reproduce the problem: with these dependencies -

gcp-bigquery-client = "0.26"
chrono = "0.4.41"

...everything builds without problem, and needing to patch only to select the specific version sounds really fishy. Maybe cargo clean would help without any patching?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.