saschagrunert / yew-router

Router extension to yew
MIT License
28 stars 6 forks source link

Example won't build #188

Closed aleksey-r closed 5 years ago

aleksey-r commented 5 years ago

Tried to build minimal.rs example with yew 0.8. Cargo.toml

[package]
name = "minimal"
version = "0.1.0"
edition = "2018"

[dependencies]
yew = "0.8"
yew-router = "*"

Result:

error[E0599]: no function or associated item named `bridge` found for type `yew_router::RouterAgent<_>` in the current scope
  --> src\main.rs:46:26
   |
46 |             RouterAgent::bridge(link.send_back(PageActions::Route));
   |                          ^^^^^^ function or associated item not found in `yew_router::RouterAgent<_>`
   |
   = note: the method `bridge` exists but the following trait bounds were not satisfied:
           `&mut yew_router::RouterAgent<_> : yew::agent::Bridged`
           `&yew_router::RouterAgent<_> : yew::agent::Bridged`
           `yew_router::RouterAgent<_> : yew::agent::Bridged`
   = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
   |
5  | use yew::agent::Bridged;
   |

error[E0277]: the trait bound `yew_router::RouterAgent<()>: yew::agent::Agent` is not satisfied
  --> src\main.rs:61:18
   |
61 |                 .send(yew_router::Request::ChangeRoute(pageroute)),
   |                  ^^^^ the trait `yew::agent::Agent` is not implemented for `yew_router::RouterAgent<()>`
warning: unused import: `Bridged`
 --> src\main.rs:6:19
  |
6 |     html, Bridge, Bridged, Component, ComponentLink, Html, Renderable,
  |                   ^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default
error: Could not compile `route`.
error: aborting due to 2 previous errors

Example builds fine with yew 0.7

issue-label-bot[bot] commented 5 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.82. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

saschagrunert commented 5 years ago

Hey @aleksey-r, I'm wondering if this is related to the project itself. Did you try to build it with the latest cargo web?

aleksey-r commented 5 years ago

I am using cargo-web 0.6.26

aleksey-r commented 5 years ago

The problem was solved by removing old Cargo.lock and rebuilding the project.

saschagrunert commented 5 years ago

Thanks! :pray: