wasm-bindgen
wasm-bindgen copied to clipboard
Are the examples in the guide/docs supposed to run live
Describe the Bug
if I go to the docs/guide like say "Hello, world"
https://rustwasm.github.io/docs/wasm-bindgen/examples/hello-world.html
And click the run button ▶, I get
Compiling playground v0.0.1 (/playground)
error[E0433]: failed to resolve: maybe a missing crate `wasm_bindgen`?
--> src/main.rs:4:5
|
4 | use wasm_bindgen::prelude::*;
| ^^^^^^^^^^^^ maybe a missing crate `wasm_bindgen`?
|
= help: consider adding `extern crate wasm_bindgen` to use the `wasm_bindgen` crate
error: cannot find attribute `wasm_bindgen` in this scope
--> src/main.rs:11:3
|
11 | #[wasm_bindgen]
| ^^^^^^^^^^^^
error: cannot find attribute `wasm_bindgen` in this scope
--> src/main.rs:6:3
|
6 | #[wasm_bindgen]
| ^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0433`.
error: could not compile `playground` (bin "playground") due to 3 previous errors
Are the supposed to run?
Steps to Reproduce
- Go to https://rustwasm.github.io/docs/wasm-bindgen/examples/hello-world.html
- Click on ▶
- See error
If applicable, add a link to a test case (as a zip file or link to a repository we can clone).
Expected Behavior
Clicking ▶ should successfully run the example
Actual Behavior
Clicking ▶ prints errors about missing wasm_bindgen
Additional Context
I'm running Chrome v120 on M1 Mac.
This is quite unfortunate, I'm not sure how this worked in the past but the Rust playground doesn't include wasm-bindgen
. Looking at their policy I don't think there is anything we can do here.
In any case, the documentation has to be adjusted to either remove the play button entirely or find an alternative.
I asked over on that repo about the policy.
https://github.com/rust-lang/rust-playground/issues/101#issuecomment-1875729447