We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Loading a wasm-pack module that tries to use web_sys::window() in a webworker fails because "Window" is not defined (capitalized).
web_sys::window()
This is due to this line of code in the built module .js file:
// ... export function __widl_instanceof_Window(idx) { return getObject(idx) instanceof Window ? 1 : 0; } // ...
I tried changing this line to be something (naive):
export function __widl_instanceof_Window(idx) { var Win = 'Window' in self ? Window : DedicatedWorkerGlobalScope; return getObject(idx) instanceof Win ? 1 : 0; }
And this works.
Recommend you find a different way to check for instance of Window that doesn't rely on the Window class being in the global scope.
Should load correctly.
Include the relevant details of your environment. wasm-pack version: 0.8.1 rustc version: 1.34.1 (fc50f328b 2019-04-24)
The text was updated successfully, but these errors were encountered:
ah jeeze sorry. Wrong repo. Already reported here: rustwasm/wasm-bindgen#1046
Sorry, something went wrong.
No branches or pull requests
🐛 Bug description
Loading a wasm-pack module that tries to use
web_sys::window()
in a webworker fails because "Window" is not defined (capitalized).This is due to this line of code in the built module .js file:
I tried changing this line to be something (naive):
And this works.
Recommend you find a different way to check for instance of Window that doesn't rely on the Window class being in the global scope.
🤔 Expected Behavior
Should load correctly.
👟 Steps to reproduce
web_sys::window()
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: 0.8.1
rustc version: 1.34.1 (fc50f328b 2019-04-24)
The text was updated successfully, but these errors were encountered: