dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Liveview with `dx` failing

Open WilliamRagstad opened this issue 1 year ago • 1 comments

Problem

Setting up a new liveview project via dx does not work with dx serve, only cargo run.

Steps To Reproduce

Steps to reproduce the behavior:

  • dx new, selecting liveview
  • dx serve fails with error: could not compile `mio` (lib) due to 44 previous errors
  • cargo run works kind of:
2024-06-16T14:52:19.352765Z ERROR dioxus_cli_config: A library is trying to access the crate's configuration, but the dioxus CLI was not used to build the application.
Dioxus Liveview App started on http://127.0.0.1:8080
could not find hot reloading server at "@dioxusin", make sure it's running

Expected behavior

Running dx serve in a newly initialized Liveview project should successfully compile and host a web server and show:

Dioxus Liveview App started on http://127.0.0.1:8080

Screenshots

If applicable, add screenshots to help explain your problem.

Environment:

  • Dioxus version: 0.5
  • Rust version: 1.78.0
  • OS info: Win 11
  • App platform: liveview (web)

Questionnaire

  • [ ] I'm interested in fixing this myself but don't know where to start
  • [ ] I would like to fix and I have a solution
  • [x] I don't have time to fix this right now, but maybe later

WilliamRagstad avatar Jun 16 '24 14:06 WilliamRagstad

dx serve only autodetects the platform for desktop, web and fullstack projects. For liveview, you need to manually pass --desktop to the cli: dx serve --platform desktop

ealmloff avatar Jun 17 '24 12:06 ealmloff