-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
WASM32 backend overrides global Worker #4198
Labels
Comments
The WebAssembly build of sharp is compiled using Line 194 in fc32e0b
There's been some discussion around improving Deno support in emscripten at emscripten-core/emscripten#12203 and emscripten-core/emscripten#19359 so this is probably an upstream thing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I realize I'm probably operating in very unsupported territory here, but I was doing some experimenting with Sharp on WASM and wanted to report what I found in case the developers want to look at it in the future.
I am experimenting with using the WASM32 backend for Sharp in Deno, mostly to see if it works but also to reduce my use of native modules. Since Deno doesn't support fine-grained control of Node dependencies, I did this test by creating a modified Sharp package to remove all optional dependencies except the WASM32 backend, but the specific problem arises just from loading
@img/sharp-wasm32/sharp.node
.Sharp correctly loads the WASM32 backend on Deno but the Enscripten-generated loader code assigns to
global.Worker
, overriding theWorker
class with an incompatible one. The result is that code that uses web workers and loads@img/sharp-wasm32
will no longer work, asnew Worker(...)
creates an object that is not compatible with the Web Workers API.Steps to reproduce:
@img/sharp-wasm32
new Worker
(specifically,addEventListener
is missing)The text was updated successfully, but these errors were encountered: