DioxusLabs / cli

Dev server, hot reload, and packaging tool for Dioxus apps. Includes VSCode Extension
161 stars 38 forks source link

`cargo install dioxus-cli` fails while compiling `dioxus-cli 0.1.41 #81

Closed gbj closed 1 year ago

gbj commented 1 year ago

Compilation fails with the following error

error[E0061]: this function takes 2 arguments but 1 argument was supplied
   --> /Users/gjohnston/.cargo/registry/src/github.com-1ecc6299db9ec823/dioxus-cli-0.1.4/src/server/mod.rs:35:23
    |
35  |       let mut watcher = RecommendedWatcher::new(move |_: notify::Result<notify::Event>| {
    |  _______________________^^^^^^^^^^^^^^^^^^^^^^^-
36  | |         if chrono::Local::now().timestamp() > last_update_time
37  | |             && builder::build(&watcher_conf).is_ok()
38  | |         {
...   |
53  | |         }
54  | |     })
    | |______- an argument of type `notify::Config` is missing
    |
note: associated function defined here
   --> /Users/gjohnston/.cargo/registry/src/github.com-1ecc6299db9ec823/notify-5.0.0/src/lib.rs:294:8
    |
294 |     fn new<F: EventHandler>(event_handler: F, config: config::Config) -> Result<Self>
    |        ^^^
help: provide the argument
    |
35  ~     let mut watcher = RecommendedWatcher::new(move |_: notify::Result<notify::Event>| {
36  +         if chrono::Local::now().timestamp() > last_update_time
37  +             && builder::build(&watcher_conf).is_ok()
38  +         {
39  +             // change the websocket reload state to true;
40  +             // the page will auto-reload.
41  +             if watcher_conf
42  +                 .dioxus_config
43  +                 .web
44  +                 .watcher
45  +                 .reload_html
46  +                 .unwrap_or(false)
47  +             {
48  +                 let _ = Serve::regen_dev_page(&watcher_conf);
49  +             }
50  +             println!("watcher send reload");
51  +             reload_tx.send("reload".into()).unwrap();
52  +             last_update_time = chrono::Local::now().timestamp();
53  +         }
54  +     }, /* notify::Config */)
    |

For more information about this error, try `rustc --explain E0061`.
error: could not compile `dioxus-cli` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `dioxus-cli v0.1.4`, intermediate artifacts can be found at `/var/folders/tn/x4pdrvrn0wb8_7dw28090bxc0000gn/T/cargo-installwsTzHZ`

I'm on

active toolchain
----------------

nightly-aarch64-apple-darwin (default)
rustc 1.67.0-nightly (b7bc90fea 2022-11-21)
ealmloff commented 1 year ago

The crates.io version is broken. I think a dependency broke on a minor version change. The master version works for the 0.2.4 release if you install it from git.

gbj commented 1 year ago

Thanks, that's what I did!