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

Dx serve failed to run project migrated from 0.5 to 0.6.1 after updating CLI #3546

Closed
Anakael opened this issue Jan 12, 2025 · 2 comments · Fixed by #3561
Closed

Dx serve failed to run project migrated from 0.5 to 0.6.1 after updating CLI #3546

Anakael opened this issue Jan 12, 2025 · 2 comments · Fixed by #3561
Labels
cli Related to the dioxus-cli program

Comments

@Anakael
Copy link
Contributor

Anakael commented Jan 12, 2025

Problem

I have a project which was created on dioxus 0.5. After updating dependency to 0.6 it continued to working file. But after I've update CLI to version 0.6.1 it started to fail on dx serve (alson on dx check) command with error:

0.373s ERROR Loading crate
   0.373s ERROR Found package NodeIndex(391)
   0.373s ERROR err=Other(Failed to find target train-solfege-dx)

image

But if I create new project with CLI 0.6.1 - it works fine.

Steps To Reproduce

Steps to reproduce the behavior:

  • Update CLI from 0.5 to 0.6.1
  • Try to run project migrated from 0.5 to 0.6.1

Expected behavior

No error

Screenshots

image

Environment:

  • Dioxus version: 0.6.1
  • Rust version: 1.81.0
  • OS info: Arch linux
  • App platform: desktop

Questionnaire

@Anakael
Copy link
Contributor Author

Anakael commented Jan 12, 2025

I've figured out what cause the problem. I have workspace with multiple project and one of them is dioxus project. And it's package name differs from bin name, so condition here can not find it. /~https://github.com/DioxusLabs/dioxus/blob/main/packages/cli/src/dioxus_crate.rs#L59
After setting bin name to package name or set --bin param it started to work.
Is it intended behavior or it should find bin in current package?

@ealmloff
Copy link
Member

The error message should be more clear in the git version of the CLI with #3505. The CLI should tell you it can't find the binary in the error with some suggested alternatives now.

It looks like cargo run will default to running the bin target if there is only one. If there is more than one, it uses the default-run key. Dioxus should probably mimic that behavior

@ealmloff ealmloff added the cli Related to the dioxus-cli program label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the dioxus-cli program
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants