You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How would one load and run external WebAssembly in Yew?
All I have found about this topic is this documentation, but how I can I do this in Yew?
Personal Motivation:
I have a rust wgpu wasm project, which of course can also run in the browser.
I now want that one page of my personal website, written in Yew, displays this project. For this, I must somehow load the wasm file.
What I have tried:
1. Linking the js and wasm files generated by wasm-pack build --target web in that project to trunks index.html, and something along the lines of:
Produces: Error: Loading module from “http://localhost:8080/pkg/other.js” was blocked because of a disallowed MIME type (“text/html”). Setting type="text/javascript;version=1.8" results in no error, but also no wasm being loaded.
Error: panicked at 'Couldn't append canvas to document body.', /home/tilmohr/.cargo/git/checkouts/fractal_rust-d303dcaeab432fcd/2e47aeb/src/lib.rs:464:14
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How would one load and run external WebAssembly in Yew?
All I have found about this topic is this documentation, but how I can I do this in Yew?
Personal Motivation:
I have a rust wgpu wasm project, which of course can also run in the browser.
I now want that one page of my personal website, written in Yew, displays this project. For this, I must somehow load the wasm file.
What I have tried:
Beta Was this translation helpful? Give feedback.
All reactions