Attempting to install and compile `dioxus-cli` crashes
I receive the following errors when I try and install this cli tooling for dioxus via cargo install dioxus-cli:
Compiling dioxus-cli v0.1.0
error[E0599]: no function or associated item named `new_immediate` found for trait object `dyn notify::Watcher` in the current scope
--> /home/ed/.cargo/registry/src/github.com-1ecc6299db9ec823/dioxus-cli-0.1.0/src/develop.rs:43:52
|
43 | let mut watcher: RecommendedWatcher = Watcher::new_immediate(move |res| {
| ^^^^^^^^^^^^^ function or associated item not found in `dyn notify::Watcher`
error[E0308]: mismatched types
--> /home/ed/.cargo/registry/src/github.com-1ecc6299db9ec823/dioxus-cli-0.1.0/src/develop.rs:53:16
|
53 | .watch(src_dir.join("src"), RecursiveMode::Recursive)
| ^^^^^^^^^^^^^^^^^^^
| |
| expected `&std::path::Path`, found struct `std::path::PathBuf`
| help: consider borrowing here: `&src_dir.join("src")`
error[E0308]: mismatched types
--> /home/ed/.cargo/registry/src/github.com-1ecc6299db9ec823/dioxus-cli-0.1.0/src/develop.rs:57:16
|
57 | .watch(src_dir.join("examples"), RecursiveMode::Recursive)
| ^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected `&std::path::Path`, found struct `std::path::PathBuf`
| help: consider borrowing here: `&src_dir.join("examples")`
Some errors have detailed explanations: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `dioxus-cli` due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `dioxus-cli v0.1.0`, intermediate artifacts can be found at `/tmp/cargo-installUlWQ20`
Caused by:
build failed
I'm currently running Windows 10, but performed the above in WSL 2, in an Ubuntu VM. Some details about my system:
Edition Windows 10 Pro
Version 21H2
Installed on 2021-11-18
OS build 19044.1415
Experience Windows Feature Experience Pack 120.2212.3920.0
Received a similar (same?) error on an M1 macOS machine:
error[E0599]: no function or associated item named `new_immediate` found for trait object `dyn notify::Watcher` in the current scope
--> /Users/edouard/.cargo/registry/src/github.com-1ecc6299db9ec823/dioxus-cli-0.1.0/src/develop.rs:43:52
|
43 | let mut watcher: RecommendedWatcher = Watcher::new_immediate(move |res| {
| ^^^^^^^^^^^^^ function or associated item not found in `dyn notify::Watcher`
error[E0308]: mismatched types
--> /Users/edouard/.cargo/registry/src/github.com-1ecc6299db9ec823/dioxus-cli-0.1.0/src/develop.rs:53:16
|
53 | .watch(src_dir.join("src"), RecursiveMode::Recursive)
| ^^^^^^^^^^^^^^^^^^^
| |
| expected `&std::path::Path`, found struct `std::path::PathBuf`
| help: consider borrowing here: `&src_dir.join("src")`
error[E0308]: mismatched types
--> /Users/edouard/.cargo/registry/src/github.com-1ecc6299db9ec823/dioxus-cli-0.1.0/src/develop.rs:57:16
|
57 | .watch(src_dir.join("examples"), RecursiveMode::Recursive)
| ^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected `&std::path::Path`, found struct `std::path::PathBuf`
| help: consider borrowing here: `&src_dir.join("examples")`
Some errors have detailed explanations: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `dioxus-cli` due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `dioxus-cli v0.1.0`, intermediate artifacts can be found at `/var/folders/c0/b9phr0yd0wj3nswph3dbdmph0000gn/T/cargo-installbH2CJb`
Caused by:
build failed
I Can also confirm issue on Ubuntu Linux:
OS: Ubuntu 21.10 x86_64
CPU: AMD Ryzen
I can also confirm this issue on Mac Monterey
I'm seeing the same issue on Pop OS w/ an AMD Ryzen CPU.
Can we develop projects without the CLI as a workaround?
I looked into the error info, it caused by Cargo auto upgrade notify's version from 5.0.0-pre.4 to 5.0.0-pre.13 which has some break changes
Sorry this issue has been open for a while! I've tried to make a few revisions - and it compiles for me - but it seems that notify is breaking windows builds. Notify is currently on a pre-release schedule which does not play well with cargo's resolver. I'm going to bump notify back down to 4.x.x so windows people can compile.
However, you don't need the cli to develop today. It provides some features to translate from html to rsx and powers the vscode extension, but neither of those things are required to build an app today - though they are tremendously helpful.
Anyways, the CLI will definitely be tested and working with dioxus 0.1.8 release - which should be in the next few days.