cli icon indicating copy to clipboard operation
cli copied to clipboard

`--profile` value of `dioxus serve` does not seem to be supplied to all sub-commands that use Cargo profiles

Open d4h0 opened this issue 2 years ago • 1 comments

Hi,

I'm using a separate Cargo profile (see https://github.com/DioxusLabs/cli/issues/90), and just noticed that this doesn't seem to work properly.

To debug another issue, I executed cargo clean in my project, after which dioxus serve --profile dev2 fails with:

[INFO] 🚅 Running build command...
[INFO] 👑 Build done.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: failed reading '/home/user/projects/app/target/wasm32-unknown-unknown/debug/app.wasm'

Caused by:
    No such file or directory (os error 2)', src/builder.rs:124:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[ERROR] 🚫 Serve startup failed: Build Failed: Bindgen build failed!
This is probably due to the Bindgen version, dioxus-cli using `0.2.81` Bindgen crate.

(Notice the debug in the path after failed reading)

Next, to test if my profile (which just inherits everything from the dev profile) is the problem, I executed dioxus serve (i.e., no custom profile), which worked.

After that, I executed dioxus serve --profile dev2 again, which now works.

My guess is, that dioxus serve --profile dev2 executes more than one command that uses Cargo profiles, but does not supply the custom profile to every of those commands.

d4h0 avatar Jan 11 '23 14:01 d4h0

The result seems to be that hot-reloading does not work at all (if a custom profile is used). At least, no change I make to my code results in a change to the content that is served to the browser.

Btw., I've installed the CLI from master.

d4h0 avatar Jan 11 '23 14:01 d4h0