Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

cargo install dioxus-cli does not compile #67

Closed
migepatschen opened this issue Sep 27, 2022 · 3 comments
Closed

cargo install dioxus-cli does not compile #67

migepatschen opened this issue Sep 27, 2022 · 3 comments

Comments

@migepatschen
Copy link

Hi everyone, I was using cargo install dioxus-cli to install, as recommended in the guide, but it fails to compile.

Version 0.1.5 compiles (via cargo install --git https://github.com/DioxusLabs/cli).


   Compiling dioxus-cli v0.1.4
error[E0061]: this function takes 2 arguments but 1 argument was supplied
   --> C:\Users\user\.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
   --> C:\Users\user\.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
@mrxiaozhuox
Copy link
Collaborator

I think you can check this issue #59

@migepatschen
Copy link
Author

So should I open another issue to change the guide instead?
People keep opening the same issue again because of it.

@mrxiaozhuox
Copy link
Collaborator

So should I open another issue to change the guide instead?
People keep opening the same issue again because of it.

Yes, You can do it. But after my plugin system finished, I will publish a new version to crates.io

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants