I am trying to run a WebAssembly program (written in Rust, the example-program from https://rustwasm.github.io/book/game-of-life/hello-world.html) with Rocket. The WebAssembly is compiled with wasm-pack and using the wasm_bindgen. The wasm binary is represented as content::JavaScript<Vec<u8>>
in Rocket and it seems like this is a 'working' solution. The binary is 'correctly' fetched, however Chrome prints a Uncaught SyntaxError: Invalid or unexpected token. Is this due to the representation as content::JavaScript<Vec<u8>>
that there is an error during fetching (although the send bytes match the ones in the wasm file) or is the bug elsewhere?
I hope someone can explane me why there is a SyntaxError in a generated binary file.