dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

new v0.6.1 app: failed to select a version for the requirement `dioxus-liveview = "^0.6.1"

Open LuckyTurtleDev opened this issue 1 year ago โ€ข 7 comments

Problem

A new created dioxus v0.6.1 fullstack app can not find the needed version for dioxus-liveview.

Steps To Reproduce

โฏ dx --version
dioxus 0.6.1 (was built without git repository)
โฏ dx new engine-test4
โœ” ๐Ÿคท   Which sub-template should be expanded? ยท Bare-Bones
โœ” ๐Ÿคท   Do you want to use Dioxus Fullstack? ยท true
โœ” ๐Ÿคท   Do you want to use Dioxus Router? ยท false
โœ” ๐Ÿคท   Do you want to use Tailwind CSS? ยท false
โœ” ๐Ÿคท   Which platform do you want DX to serve by default? ยท Web
  11.262s  INFO Generated project at /home/lukas/git/engine-test4

`cd` to your project and run `dx serve` to start developing.
If using Tailwind, make sure to run the Tailwind CLI.
More information is available in the generated `README.md`.

Build cool things! โœŒ๏ธ


โฏ cd engine-test4/

โฏ dx serve --platform web
14:23:23 [dev] -----------------------------------------------------------------
                Serving your Dioxus app: engine-test4 ๐Ÿš€
                โ€ข Press `ctrl+c` to exit the server
                โ€ข Press `r` to rebuild the app
                โ€ข Press `o` to open the app
                โ€ข Press `v` to toggle verbose logging
                โ€ข Press `/` for more commands and shortcuts
                Learn more at https://dioxuslabs.com/learn/0.6/getting_started
               ----------------------------------------------------------------
14:23:23 [dev] Installing [email protected]...
14:23:24 [dev] [email protected] was successfully installed from GitHub.
14:23:25 [cargo] error: failed to select a version for the requirement `dioxus-liveview = "^0.6.1"`
14:23:25 [cargo] candidate versions found which didn't match: 0.6.0, 0.6.0-rc.0, 0.6.0-alpha.5, ...
14:23:25 [cargo] location searched: crates.io index
14:23:25 [cargo] required by package `dioxus v0.6.1`
14:23:25 [cargo]     ... which satisfies dependency `dioxus = "^0.6.0"` (locked to 0.6.1) of package `engine-test4 v0.1.0 (/home/lukas/git/engine-test4)`
14:23:25 [cargo] if you are looking for the prerelease package it needs to be specified explicitly
14:23:25 [cargo]     dioxus-liveview = { version = "0.6.0-rc.0" }
14:23:25 [dev] Cargo build failed - no output location. Toggle tracing mode (press `t`) for more information.
14:23:25 [dev] Build failed: Other(Build did not return an executable)
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ /:more โ•ฎ
โ”‚  App:     โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”  โŒ           Platform: Web + fullstack                     โ”‚
โ”‚  Server:  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”  โŒ           App features: ["web"]                         โ”‚
โ”‚  Status:  Failed                                   Serving at: http://127.0.0.1:8080             โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ


โœ˜ dx serve --platform web --verbose
14:26:40 [dev] Loading crate
14:26:40 [dev] Found package NodeIndex(46)
14:26:40 [dev] Could not find explicit feature for platform server, passing `fallback` instead
14:26:40 [dev] Verifying tooling...
14:26:40 [dev] Watching path "/home/lukas/git/engine-test4/Cargo.toml"
14:26:40 [dev] Watching path "/home/lukas/git/engine-test4/Dioxus.toml"
14:26:40 [dev] Watching path "/home/lukas/git/engine-test4/README.md"
14:26:40 [dev] Watching path "/home/lukas/git/engine-test4/assets"
14:26:40 [dev] Watching path "/home/lukas/git/engine-test4/src"
14:26:40 [dev] Watching path "/home/lukas/git/engine-test4"
14:26:40 [dev] -----------------------------------------------------------------
                Serving your Dioxus app: engine-test4 ๐Ÿš€
                โ€ข Press `ctrl+c` to exit the server
                โ€ข Press `r` to rebuild the app
                โ€ข Press `o` to open the app
                โ€ข Press `v` to toggle verbose logging
                โ€ข Press `/` for more commands and shortcuts
                Learn more at https://dioxuslabs.com/learn/0.6/getting_started
               ----------------------------------------------------------------
14:26:40 [dev] Running build command...
14:26:40 [dev] Building app...
14:26:40 [dev] Initialized Root dir: "/home/lukas/git/engine-test4/target/dx/engine-test4/debug/web/public"
14:26:40 [dev] Initialized Exe dir: "/home/lukas/git/engine-test4/target/dx/engine-test4/debug/web/public/wasm"
14:26:40 [dev] Initialized Asset dir: "/home/lukas/git/engine-test4/target/dx/engine-test4/debug/web/public/assets"
14:26:40 [dev] Executing cargo...
14:26:40 [dev] cargo args: ["--profile", "wasm-dev", "--target", "wasm32-unknown-unknown", "--verbose", "--features", "web", "--bin", "engine-test4"]
14:26:40 [dev] Building server...
14:26:40 [dev] Building app...
14:26:40 [dev] Executing cargo...
14:26:40 [dev] cargo args: ["--profile", "server-dev", "--verbose", "--features", "dioxus/server", "--bin", "engine-test4"]
14:26:41 [dev] cargo args: ["--profile", "wasm-dev", "--target", "wasm32-unknown-unknown", "--verbose", "--features", "web", "--bin", "engine-test4"]
14:26:41 [dev] cargo args: ["--profile", "server-dev", "--verbose", "--features", "dioxus/server", "--bin", "engine-test4"]
14:26:41 [cargo] error: failed to select a version for the requirement `dioxus-liveview = "^0.6.1"`
14:26:41 [cargo] candidate versions found which didn't match: 0.6.0, 0.6.0-rc.0, 0.6.0-alpha.5, ...
14:26:41 [cargo] location searched: crates.io index
14:26:41 [cargo] required by package `dioxus v0.6.1`
14:26:41 [cargo]     ... which satisfies dependency `dioxus = "^0.6.0"` (locked to 0.6.1) of package `engine-test4 v0.1.0 (/home/lukas/git/engine-test4)`
14:26:41 [cargo] if you are looking for the prerelease package it needs to be specified explicitly
14:26:41 [cargo]     dioxus-liveview = { version = "0.6.0-rc.0" }
14:26:41 [dev] Cargo build failed - no output location. Toggle tracing mode (press `t`) for more information.
14:26:41 [dev] Setting builder to failed state
14:26:41 [dev] Build failed: Other(Build did not return an executable)
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ /:more โ•ฎ
โ”‚  App:     โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”  โŒ           Platform: Web + fullstack                     โ”‚
โ”‚  Server:  โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”  โŒ           App features: ["web"]                         โ”‚
โ”‚  Status:  Failed                                   Serving at: http://127.0.0.1:8080             โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Expected behavior

Screenshots

Environment:

  • Dioxus version: v0.6.1
  • Rust version: rustc 1.83.0 (90b35a623 2024-11-26)
  • OS info: arch linux
  • App platform: fullstack

Questionnaire

LuckyTurtleDev avatar Dec 18 '24 13:12 LuckyTurtleDev

The 0.6.1 version of dioxus liveview has been published, so this might be a caching issue. Running cargo update fixes the error for me. After running cargo update in a different project, I don't see the error when creating a new project with dioxus 0.6.1

ealmloff avatar Dec 18 '24 14:12 ealmloff

I have the same problem, both on Fedora 41 and macOS 15.2. Unfortunately, running cargo update did not fix the issue for me. I can still reproduce the issue following the steps described above by @LuckyTurtleDev .

sknauff avatar Dec 19 '24 10:12 sknauff

Same here on MacOS. Happens to me also when I install 0.6.0.

yanshay avatar Dec 19 '24 12:12 yanshay

What solved this for me was erasing the cargo registry, in my case it's at ~/.cargo/registry, so just erased (well started with renaming) the folder.

Credits go to @DogeDark who replied on Discord.

yanshay avatar Dec 19 '24 18:12 yanshay

Hmmm, https://crates.io/crates/dioxus-liveview is live....

This is most likely related to caching being "sticky" - especially since the Liveview codebase didn't change between 0.6.0 and 0.6.1.

I believe cargo gets confused on some platforms with mtime and maybe special git setups.

If the codebase didn't change cargo might not be actually registering it as a new version.

jkelleyrtp avatar Dec 19 '24 18:12 jkelleyrtp

If the codebase didn't change cargo might not be actually registering it as a new version.

I don't fully understand this issue but maybe you want to change it then even if nothing changes, just to avoid such issues.

yanshay avatar Dec 19 '24 18:12 yanshay

cargo update did not work for me either (Fedora 41), but adding the dependency to my project via Cargo.toml did work. Of course that is not very practical. So this might be a real caching bug in cargo?

Anyway, removing the whole registry directory ~/.cargo/registry as suggested did work. I hope we don't have to do this on every dioxus release now ๐Ÿ˜…

niclashoyer avatar Dec 19 '24 23:12 niclashoyer

I also had the same issue and worked only after I removed the directory /.cargo/registry.

vaniusrb avatar Dec 21 '24 22:12 vaniusrb

is this a issue that is caused by cargo or by cargo metadata? I would expect that if cargo did not find the right version local, it would update its crates.io index.

LuckyTurtleDev avatar Dec 22 '24 18:12 LuckyTurtleDev

looks like a caching or config issue, and not related to dioxus-liveview.

I did not want to delete .cargo/registry so I chose to directly import dioxus-liveview = "0.6.1". Then I had to also import dioxus-isrg = "0.6.1" and dioxus-ssr = "0.6.1" and it finally compiled.

After that I could delete the extra imports and import only dioxus and it works fine.

rivasdiaz avatar Jan 03 '25 21:01 rivasdiaz

Seeing as this is likely a issue with cargo, I'm going to close this. In the future, we won't release updates to crates that didn't change between versions since that might be triggering the caching bug.

jkelleyrtp avatar Jan 09 '25 03:01 jkelleyrtp

This is indeed a bug in cargo.

https://github.com/rust-lang/cargo/blob/51346addcc23a4a965b5c016251eb52b789e866c/src/cargo/core/compiler/fingerprint/mod.rs#L332

Unfortunately the tool we use to publish with (cargo workspaces) has a bug where it doesn't updated workspace dependencies making upgrades to workspaces quite tedious. I need to go fix that.

jkelleyrtp avatar Jan 29 '25 19:01 jkelleyrtp