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
// A dependency graph that contains any wasm must all be imported// asynchronously. This `bootstrap.js` file does the single async import, so// that no one else needs to worry about it again.import("./index.js").catch(e=>console.error("Error importing `index.js`:",e));letapi=import("learn_rust_wasm");
web/index.html
<!DOCTYPE html><html><head><metacharset="utf-8"><title>Hello wasm-pack!</title></head><body><noscript>This page contains webassembly and javascript content, please enable javascript in your browser.</noscript><scriptsrc="./bootstrap.js"></script></body></html>
Here is a minimal example.
Make a new project. Use these files:
lib.rs:
Cargo.toml
.cargo/config.toml
web/index.js
web/bootstrap.js
web/index.html
web/package.json
web/webpack.config.js
then run:
When you go to
http://localhost:8080
and then run this, it will fail in this way:The text was updated successfully, but these errors were encountered: