Good day,
Currently I'm writing rust+wgpu module for plotting graphs in html and have a fundamental problem: I cannot use my module. All works fine using #[wasm_bindgen(start)], but I cannot use the other #[wasm_bindgen] functions. I see a result of start() but get nothing from the other functions. What's happens? I don't understand the problem and I spend a full day to find any working sample.
- I use
trunk serve
but I also try custom actix server - Console msg:
The `integrity` attribute is currently ignored for preload destinations that do not support subresource integrity. See https://crbug.com/981419 for more information
localhost./:6 Unchecked runtime.lastError: The message port closed before a response was received.
wasm.js:1 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
- I tryed
#[no_mangle] pub extern "C" fn
- I tryed crate-type: cdylib, staticlib, rlib
- Even a giude example doesn't work.
This already feels like a curse...
How properly create and use wasm module into HTML and use like a common .js package?