thedodd / ybc

A Yew component library based on the Bulma CSS framework.
Apache License 2.0
258 stars 37 forks source link

Component implementation not being satisfied #11

Closed quinnjr closed 3 years ago

quinnjr commented 3 years ago

Issue: Component implementation not being satisfied.

Working with the master branch of yew gives the following error for many (if not all) components in the library:

error[E0599]: no function or associated item named `new` found for struct `VChild<Navbar>` in the current scope
   --> src/model.rs:149:18
    |
149 |                 <ybc::Navbar classes="is-light">
    |                  ^^^^^^^^^^^ function or associated item not found in `VChild<Navbar>`
    | 
   ::: /home/joseph/.local/share/cargo/git/checkouts/ybc-98c1ec494f717c00/a4a4dd1/src/components/navbar.rs:57:1
    |
57  | pub struct Navbar {
    | ----------------- doesn't satisfy `Navbar: yew::Component`
    |
    = note: the method `new` exists but the following trait bounds were not satisfied:
            `Navbar: yew::Component`

error[E0277]: the trait bound `Navbar: yew::Component` is not satisfied
   --> src/model.rs:149:18
    |
149 |                 <ybc::Navbar classes="is-light">
    |                  ^^^^^^^^^^^ the trait `yew::Component` is not implemented for `Navbar`

In trying to debug this issue, I found that it looks like some problem related to https://github.com/yewstack/yew/blob/master/yew/src/virtual_dom/vcomp.rs#L72.

quinnjr commented 3 years ago

Issue turned out to be an error with mixing Yew versions.

thedodd commented 3 years ago

Makes sense! Thanks for digging into this.