-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Error when executing stdweb::web:window function #1713
Comments
Thanks for the report! I think though this may be a bug in stdweb? It may be that a function is typed to return a number but it doesn't locally. I was able to reproduce this, but the return value was |
As a more meta note, stdweb currently doesn't interop very well with wasm-bindgen, so I recommend using one or the other. For wasm-bindgen, you can use |
Sure, thanks for looking! |
and just to add some color, I really like aspects of both libraries, I feel as if |
Indeed web-sys is intentionally low level, but that's why we created gloo, which contains high-level abstractions. And I created a proposal to have high-level event listeners, very similar to what stdweb does. |
Describe the Bug
After scaffolding a project using https://github.com/rustwasm/wasm-pack-template , I am encountering the follow error when attempting to invoke the
stdweb::web::window
function (stdweb
version0.4.18
), using thenpm start
command ofwasm-pack-template
, which uses the webpackWasmPackPlugin
:lib.rs:
Steps to Reproduce
npm init rust-webpack bug && cd bug
(ensure you have at least NPM 6)stdweb = "0.4.18"
as a dependency in yourCargo.toml
./src/lib.rs
to be what's in the description.npm start
If applicable, add a link to a test case (as a zip file or link to a repository we can clone).
Expected Behavior
executes without error
Actual Behavior
Attached error is thrown. Exact line below
Additional Context
Thank you to everyone who contributed to this project as well as stdweb. It is a beautiful thing to see collaboration such as koute/stdweb#318 taking place in the open source community. It's truly amazing what can be done when brilliant people from all over the world put their minds together.
The text was updated successfully, but these errors were encountered: