setzer22 / egui_node_graph

Build your node graph applications in Rust, using egui
MIT License
732 stars 137 forks source link

Cant Compile to web #83

Open asgore-undertale opened 1 year ago

asgore-undertale commented 1 year ago
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 commented 1 year ago

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