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

[BUG]: Not working with leptos 0.6 #12

Closed
Himadu2000 opened this issue May 22, 2024 · 1 comment
Closed

[BUG]: Not working with leptos 0.6 #12

Himadu2000 opened this issue May 22, 2024 · 1 comment

Comments

@Himadu2000
Copy link

Describe the bug
Running leptos-markdown commit 5d20776 (latest) with leptos 0.6 will give following error,

error[E0277]: the trait bound `fn(MarkdownProps) -> impl leptos_dom::IntoView {Markdown}: leptos::Component<_>` is not satisfied
   --> src\main.rs:5:31
    |
5   |     mount_to_body(|| view! { <Markdown src="# Markdown Power !"/> })
    |                               ^^^^^^^^ the trait `leptos::Component<_>` is not implemented for fn item `fn(MarkdownProps) -> impl leptos_dom::IntoView {Markdown}`
    |
help: trait impls with same name found
   --> C:\Users\User\.cargo\registry\src\index.crates.io-6f17d22bba15001f\leptos-0.5.7\src\lib.rs:309:1
    |
309 |   impl<F, R> Component<EmptyPropsBuilder> for F where F: FnOnce() -> R {}
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
310 |
311 | / impl<P, F, R> Component<P> for F
312 | | where
313 | |     F: FnOnce(P) -> R,
314 | |     P: Props,
    | |_____________^
    = note: perhaps two different versions of crate `leptos` are being used?
note: required by a bound in `component_props_builder`
   --> C:\Users\User\.cargo\registry\src\index.crates.io-6f17d22bba15001f\leptos-0.6.11\src\lib.rs:327:15
    |
326 | pub fn component_props_builder<P: PropsOrNoPropsBuilder>(
    |        ----------------------- required by a bound in this function
327 |     _f: &impl Component<P>,
    |               ^^^^^^^^^^^^ required by this bound in `component_props_builder`

error[E0277]: the trait bound `&fn(MarkdownProps) -> impl leptos_dom::IntoView {Markdown}: ComponentConstructor<_>` is not satisfied
   --> src\main.rs:5:31
    |
5   |     mount_to_body(|| view! { <Markdown src="# Markdown Power !"/> })
    |                              -^^^^^^^^ the trait `ComponentConstructor<_>` is not implemented for `&fn(MarkdownProps) -> impl leptos_dom::IntoView {Markdown}`
    |                              |
    |                              required by a bound introduced by this call
    |
note: required by a bound in `component_view`
   --> C:\Users\User\.cargo\registry\src\index.crates.io-6f17d22bba15001f\leptos-0.6.11\src\lib.rs:333:34
    |
333 | pub fn component_view<P>(f: impl ComponentConstructor<P>, props: P) -> View {
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `component_view`

For more information about this error, try `rustc --explain E0277`.

To Reproduce
Steps to reproduce the behavior:

  1. Create a basic Leptos CSR app.
  2. Add Leptos Markdown as a dependency. Which is,
    leptos-markdown = { git="https://github.com/rambip/leptos-markdown", rev = "96042d8" }.
  3. Start the app.
  4. See error.
@srid
Copy link
Contributor

srid commented Oct 12, 2024

This is now fixed by #13 which just got merged

@rambip rambip closed this as completed Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants