Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Cant Compile to web #83

Open
asgore-undertale opened this issue Apr 15, 2023 · 1 comment
Open

Cant Compile to web #83

asgore-undertale opened this issue Apr 15, 2023 · 1 comment

Comments

@asgore-undertale
Copy link

Im facing this error when i try to compile the node editor to web:
error[E0061]: this function takes 3 arguments but 2 arguments were supplied
--> egui_node_graph_example\src\lib.rs:22:5
|
22 | eframe::start_web(canvas_id, Box::new(app))
| ^^^^^^^^^^^^^^^^^-------------------------- an argument of type Box<(dyn for<'r, 's> FnOnce(&'r CreationContext<'s>) -> Box<(dyn App + 'static)> + 'static)> is missing
|
note: expected struct WebOptions, found struct Box
--> egui_node_graph_example\src\lib.rs:22:34
|
22 | eframe::start_web(canvas_id, Box::new(app))
| ^^^^^^^^^^^^^
= note: expected struct WebOptions
found struct Box<NodeGraphExample>
note: function defined here
--> C:\Users\2021.cargo\registry\src\github.com-1ecc6299db9ec823\eframe-0.19.0\src\lib.rs:112:8
|
112 | pub fn start_web(
| ^^^^^^^^^
help: provide the argument
|
22 | eframe::start_web(canvas_id, /* WebOptions /, / Box<(dyn for<'r, 's> FnOnce(&'r CreationContext<'s>) -> Box<(dyn App + 'static)> + 'static)> */)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0308]: mismatched types
--> egui_node_graph_example\src\lib.rs:22:5
|
20 | pub fn start(canvas_id: &str) -> Result<(), eframe::wasm_bindgen::JsValue> {
| ----------------------------------------- expected Result<(), JsValue> because of return type
21 | let app = NodeGraphExample::default();
22 | eframe::start_web(canvas_id, Box::new(app))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct Arc
|
= note: expected enum Result<(), _>
found enum Result<Arc<eframe::egui::mutex::Mutex<AppRunner>>, _>

Some errors have detailed explanations: E0061, E0308.
For more information about an error, try rustc --explain E0061.
error: could not compile egui_node_graph_example due to 2 previous errors

@Neopallium
Copy link

I created a PR #107 that fixes web support in the example app.

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