DioxusLabs / dioxus

Fullstack GUI library for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
19.33k stars 736 forks source link

`dx serve` output is not entirely clear #2176

Open foresterre opened 3 months ago

foresterre commented 3 months ago

Problem

Running dx serve after initiating a new app logs a panic during compilation, and the status of the serve command is not clear.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Installed dx with cargo install dioxus-cli (0.5.4 on crates.io)
  2. Created a new Dioxus application
> dx new
✔ 🤷   Which sub-template should be expanded? · Fullstack
🤷   Project Name: releasetool
✔ 🤷   Should the application use the Dioxus router? · true
✔ 🤷   How do you want to create CSS? · Vanilla
  1. run: cd releasetool
  2. run: dx serve

Output in gist (too long for github issue): https://gist.github.com/foresterre/3630ef11472c4fdc1523af2397f73818

Expected behavior

Observed effects:

Panic excerpt from log above:

\ ⚙️ Compiling dioxus-fullstack 0.5.0 (git+https://github.com/DioxusLabs/dioxus#44471f4918529fd15a143854984ce3b3d58c07a9\ ⚙️ Compiling releasetool 0.1.0 (path+file:///C:/a/releasetool)
build desktop done
- 💼 Waiting to start building the project...                                                                           Dioxus @ v0.5.4 [03:39:29]

    > Hot Reload Mode: RSX
    > Watching: [ src, assets, Cargo.toml, Dioxus.toml ]
    > Custom index.html: None
    > Serve index.html on 404: True

    > Build Features: [ server ]
    > Build Profile: Debug
    > Build took: 81333 millis

Listening on 127.0.0.1:8080
thread 'main' panicked at C:\Users\a\.cargo\git\checkouts\dioxus-1e619ce595d3799d\44471f4\packages\fullstack\src\serve_config.rs:111:37:
Failed to find index.html. Make sure the index_path is set correctly and the WASM application has been built.: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
stack backtrace:
- 💼 Waiting to start building the project...                                                                           Dioxus @ v0.5.4 [03:39:29]

    > Hot Reload Mode: RSX
    > Watching: [ src, assets, Cargo.toml, Dioxus.toml ]
    > Custom index.html: None
    > Serve index.html on 404: True

    > Build Features: [ server ]
    > Build Profile: Debug
    > Build took: 81333 millis

Listening on 127.0.0.1:8080

Rerunning dx serve

Rerunning the whole thing ``` dx serve / ⚙️ Compiling proc-macro2 1.0.79 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling unicode-ident 1.0.12 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling autocfg 1.2.0 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling once_cell 1.19.0 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling version_check 0.9.4 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling pin-project-lite 0.2.13 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling log 0.4.21 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling windows_x86_64_msvc 0.48.5 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling parking_lot_core 0.9.9 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling scopeguard 1.2.0 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling futures-core 0.3.30 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling itoa 1.0.11 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling serde 1.0.197 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling smallvec 1.13.2 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling pin-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling futures-task 0.3.30 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling futures-io 0.3.30 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling futures-sink 0.3.30 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling memchr 2.7.2 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling fnv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index) / ⚙️ Compiling mime_guess 2.0.4 (registry+https://github.com/rust-lang/crates.io-index) build desktop done Dioxus @ v0.5.4 [04:05:03] > Hot Reload Mode: RSX > Watching: [ src, assets, Cargo.toml, Dioxus.toml ] > Custom index.html: None > Serve index.html on 404: True > Build Features: [ server ] > Build Profile: Debug > Build took: 741 millis Listening on 127.0.0.1:8080 \ ⚙️ Compiling proc-macro2 1.0.79 (registry+https://github.com/rust-lang/crates.io-index) \ ⚙️ Compiling unicode-ident 1.0.12 (registry+https://github.com/rust-lang/crates.io-index) \ ⚙️ Compiling cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index) \ ⚙️ Compiling once_cell 1.19.0 (registry+https://github.com/rust-lang/crates.io-index) \ ⚙️ Compiling autocfg 1.2.0 (registry+https://github.com/rust-lang/crates.io-index) \ ⚙️ Compiling log 0.4.21 (registry+https://github.com/rust-lang/crates.io-index) \ ⚙️ Compiling serde 1.0.197 (registry+https://github.com/rust-lang/crates.io-index) - ⚙️ Compiling async-trait 0.1.79 (registry+https://github.com/rust-lang/crates.io-index) [INFO] dioxus_fullstack::render - Rebuilding vdom [INFO] dioxus_core::diff::node - creating template self=VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "src\\main.rs:22:5:426", roots: [Dynamic { id: 0 }], node_paths: [[0]], attr_paths: [] } }, dynamic_nodes: [Component(VComponent { name: "Router" })], dynamic_attrs: [] }, mount: Cell { value: MountId(0) } } mount=MountId(0)[INFO] dioxus_core::diff::node - creating template self=VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "C:\\Users\\a\\.cargo\\git\\checkouts\\dioxus-1e619ce595d3799d\\44471f4\\packages\\router\\src\\components\\router.rs:96:5:37083", roots: [Dynamic { id: 0 }], node_paths: [[0]], attr_paths: [] } }, dynamic_nodes: [Component(VComponent { name: "Outlet" })], dynamic_attrs: [] }, mount: Cell { value: MountId(1) } } mount=MountId(1) [INFO] dioxus_core::diff::node - creating template self=VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "src\\main.rs:6:17:196", roots: [Dynamic { id: 0 }], node_paths: [[0]], attr_paths: [] } }, dynamic_nodes: [Component(VComponent { name: "Home" })], dynamic_attrs: [] }, mount: Cell { value: MountId(2) } } mount=MountId(2) [INFO] dioxus_core::diff::node - creating template self=VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "src\\main.rs:40:5:742", roots: [Dynamic { id: 0 }, Element { tag: "div", namespace: None, attrs: [], children: [Element { tag: "h1", namespace: None, attrs: [], children: [DynamicText { id: 1 }] }, Element { tag: "button", namespace: None, attrs: [Dynamic { id: 0 }], children: [Text { text: "Up high!" }] }, Element { tag: "button", namespace: None, attrs: [Dynamic { id: 1 }], children: [Text { text: "Down low!" }] }, Element { tag: "button", namespace: None, attrs: [Dynamic { id: 2 }], children: [Text { text: "Get Server Data" }] }, Element { tag: "p", namespace: None, attrs: [], children: [DynamicText { id: 2 }] }] }], node_paths: [[0], [1, 0, 0], [1, 4, 0]], attr_paths: [[1, 1], [1, 2], [1, 3]] } }, dynamic_nodes: [Component(VComponent { name: "Link" }), Text(VText { value: "High-Five counter: 0" }), Text(VText { value: "Server data: ..." })], dynamic_attrs: [[Attribute { name: "onclick", value: Listener, namespace: None, volatile: false }], [Attribute { name: "onclick", value: Listener, namespace: None, volatile: false }], [Attribute { name: "onclick", value: Listener, namespace: None, volatile: false }]] }, mount: Cell { value: MountId(3) } } mount=MountId(3) [INFO] dioxus_core::diff::node - creating template self=VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "C:\\Users\\a\\.cargo\\git\\checkouts\\dioxus-1e619ce595d3799d\\44471f4\\packages\\router\\src\\components\\link.rs:282:5:32703", roots: [Element { tag: "a", namespace: None, attrs: [Dynamic { id: 0 }, Dynamic { id: 1 }, Dynamic { id: 2 }, Dynamic { id: 3 }, Dynamic { id: 4 }, Dynamic { id: 5 }, Dynamic { id: 6 }, Dynamic { id: 7 }], children: [Dynamic { id: 0 }] }], node_paths: [[0, 0]], attr_paths: [[0], [0], [0], [0], [0], [0], [0], [0]] } }, dynamic_nodes: [Fragment([VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "src\\main.rs:40:5:842", roots: [Text { text: "Go to blog" }], node_paths: [], attr_paths: [] } }, dynamic_nodes: [], dynamic_attrs: [] }, mount: Cell { value: MountId(18446744073709551615) } }])], dynamic_attrs: [[Attribute { name: "onclick", value: Listener, namespace: None, volatile: false }], [Attribute { name: "href", value: Text("/blog/0"), namespace: None, volatile: false }], [Attribute { name: "onmounted", value: Listener, namespace: None, volatile: false }], [Attribute { name: "dioxus-prevent-default", value: Text("onclick"), namespace: None, volatile: false }], [Attribute { name: "class", value: None, namespace: None, volatile: false }], [Attribute { name: "rel", value: None, namespace: None, volatile: false }], [Attribute { name: "target", value: None, namespace: None, volatile: false }], []] }, mount: Cell { value: MountId(4) } } mount=MountId(4) [INFO] dioxus_core::diff::node - creating template self=VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "src\\main.rs:40:5:842", roots: [Text { text: "Go to blog" }], node_paths: [], attr_paths: [] } }, dynamic_nodes: [], dynamic_attrs: [] }, mount: Cell { value: MountId(5) } } mount=MountId(5) [INFO] dioxus_fullstack::render - Suspense resolved spinning up hot reloading hot reloading ready 🔥 Hot Reload WebSocket connected 🔮 Finding updates since last compile... Connected to hot reloading 🚀 finished Server received: Hello from the server! ```

screenshots

I've only two screenshots which were both taken after rerunning the dx serve command a few times. They both show the tool output after running dx serve

A:

2024_03_29_WindowsTerminal_986_939_Z2TCA2Sk9y

B:

2024_03_29_WindowsTerminal_1017_914_hPOvs4ozjG

Environment:

Questionnaire