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

Dependency Conflict with prettyplease When Adding leptosfmt #171

Closed
slanesuke opened this issue Mar 12, 2025 · 2 comments
Closed

Dependency Conflict with prettyplease When Adding leptosfmt #171

slanesuke opened this issue Mar 12, 2025 · 2 comments

Comments

@slanesuke
Copy link

Hey there

I'm just getting started with Leptos and following the directions from the Leptos Book for the first tutorial projects. I wanted to add leptosfmt to format my code, but I ran into a dependency conflict related to prettyplease. Not sure if I’m doing something wrong, but I keep getting this error:

cargo add leptosfmt                                                                                                               ─╯
    Updating crates.io index
      Adding leptosfmt v0.1.33 to dependencies
    Updating crates.io index
error: failed to select a version for `prettyplease`.
    ... required by package `leptos_macro v0.7.7`
    ... which satisfies dependency `leptos_macro = "^0.7.7"` of package `leptos v0.7.7`
    ... which satisfies dependency `leptos = "^0.7.7"` of package `leptos-tutorial v0.1.0 (/Users/ianslane/Desktop/Rust_Portfolio/leptos-tutorial)`
versions that meet the requirements `^0.2.25` are: 0.2.30, 0.2.29, 0.2.28, 0.2.27, 0.2.26, 0.2.25

the package `prettyplease` links to the native library `prettyplease02`, but it conflicts with a previous package which links to `prettyplease02` as well:
package `leptosfmt-prettyplease v0.1.33`
    ... which satisfies dependency `leptosfmt-prettyplease = "^0.1.33"` of package `leptosfmt-formatter v0.1.33`
    ... which satisfies dependency `leptosfmt-formatter = "^0.1.33"` of package `leptosfmt v0.1.33`
    ... which satisfies dependency `leptosfmt = "^0.1.33"` of package `leptos-tutorial v0.1.0 (/Users/ianslane/Desktop/Rust_Portfolio/leptos-tutorial)`
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 = "prettyplease02"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `prettyplease` which could resolve this conflict

I tried:

  • Following the Leptos Book's setup
  • Ran cargo update, but no luck
  • Checked cargo tree -d, but it gives the same error
  • Tried forcing a single prettyplease version using in Cargo.toml, but the conflict remains

Not sure if I’m missing something obvious, or if this is a bug. Any help would be appreciated! Thanks!

@bram209
Copy link
Owner

bram209 commented Mar 13, 2025

You shouldn’t add leptosfmt as a dependency but install it as a standalone executable by using cargo install instead of cargo add

@slanesuke
Copy link
Author

Ah! Thank you.

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

2 participants