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

Canvas example needs HTML Canvas element #285

Open
misaim opened this issue Dec 23, 2022 · 0 comments
Open

Canvas example needs HTML Canvas element #285

misaim opened this issue Dec 23, 2022 · 0 comments

Comments

@misaim
Copy link

misaim commented Dec 23, 2022

Where in the docs did you come across this?
https://rustwasm.github.io/docs/wasm-bindgen/examples/2d-canvas.html

Describe what about it does not make sense
Currently this documentation doesn't include a custom html file. This raises a confusing Uncaught (in promise) RuntimeError: unreachable executed error message on loading of the compiled .wasm file.

Note that I'm using --target web (although no-modules has the same problem) - I am unsure if using all the fancy bundle tools generates html with a canvas element by default.

How could we improve it?
Include a html file. Can be as basic as possible, with a dedicated canvas element (id of "canvas") e.g:
<canvas id="canvas" width="150" height="150"></canvas>
...Taken from the hosted example.

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

No branches or pull requests

1 participant