koute/stdweb

Error loading wasm-bindgen-minimal example

cmontella opened this issue · 1 comments

I tried running the wasm-bindgen-minimal example and got this error:

Error loading Rust wasm module 'wasm_bindgen_minimal': TypeError: Import module '__wbindgen_placeholder__' is invalid

0: Import module '__wbindgen_placeholder__' is invalid
wasm-bindgen-minimal.js (46,20)

Compiled on Windows 10
Rust: nightly-2020-04-06-x86_64-pc-windows-msvc
Cargo web: 0.6.26
Browser: Firefox 75.0

I followed these steps:

cargo install cargo-web

gh repo clone koute/stdweb

cd stdweb

cd examples

cd canvas 

cargo web start --target=wasm32-unknown-unknown

Terminal read warning: 47 warnings emitted - but I still tried to see the final result in the browser.

I got this error in my browser's console for localhost:8000:

canvas.js:631 Encountered a panic!

__cargo_web_snippet_dc2fd915bd92f9e9c6a3bd15174f1414eee3dbaf @ canvas.js:631
canvas.js:583 Panic location: /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/mem/mod.rs:659

I tried the todomvc example and got the same errors in terminal and console. Could not interact with page for the todomvc example, and the canvas example resulted in a blank screen.