Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are the examples in the guide/docs supposed to run live #3758

Open
greggman opened this issue Dec 28, 2023 · 2 comments
Open

Are the examples in the guide/docs supposed to run live #3758

greggman opened this issue Dec 28, 2023 · 2 comments
Labels

Comments

@greggman
Copy link

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

  1. Go to https://rustwasm.github.io/docs/wasm-bindgen/examples/hello-world.html
  2. Click on ▶
  3. 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
Screenshot 2023-12-28 at 08 24 13

Additional Context

I'm running Chrome v120 on M1 Mac.

@greggman greggman added the bug label Dec 28, 2023
@daxpedda
Copy link
Collaborator

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.

@greggman
Copy link
Author

greggman commented Jan 3, 2024

I asked over on that repo about the policy.

rust-lang/rust-playground#101 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants