Harshit Rajput
Harshit Rajput

Reputation: 13

No matching package found

I am trying to integrate an API in a yew project and facing the following issue:

Dark@Dark:/var/www/html/yew-practice$ wasm-pack build --target web
Error: Error during execution of `cargo metadata`:     Updating crates.io index
    Updating git repository `https://github.com/yewstack/yew`
error: no matching package found
searched package name: `yewtil`
perhaps you meant:      yew
location searched: https://github.com/yewstack/yew

Cargo.toml:

[package]
name = "yew-practice"
version = "0.1.0"
edition = "2018"

[lib]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = "^0.2"
serde="1"
yew = { git = "https://github.com/yewstack/yew" }
yewtil = { git = "https://github.com/yewstack/yew", features = ["fetch"] }

How do I solve the problem above?

Upvotes: 1

Views: 4671

Answers (2)

mariolu
mariolu

Reputation: 700

Yew git repository is not a valid address, it must end with .git.

git = "https://github.com/yewstack/yew.git"

Upvotes: 1

jdno
jdno

Reputation: 4364

The error tells you that no package yewtil was found in the Git repository. If you go to the repository and check its Cargo.toml file, you will indeed notice that it doesn't include a yewtil package.

I searched in the repository for yewtil, and found this pull request that refactored the project and merged yewtil into other packages: yewstack/yew#1842.

You have two options now:

  1. Drop the dependency on yewtil, and use the documentation to figure out where the features have moved that you want to use.
  2. Add a tag key to the dependency to pull in the latest release that included yewtil, or simply switch to the latest published version on crates.io.

If you want to get the latest features from yew, which appears to be the case given that you're pulling in the package from GitHub and not crates.io, go with option 1. You can use the documentation and the examples in the master branch to see how to use the package in its latest version.

Upvotes: 2

Related Questions