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
related to #9140, which was closed as structured cloning had not yet been implemented.
Now that #3557 has been implemented, I would expect the following to work given the following documentation:
A WebAssembly.Module object representing the compiled WebAssembly module. * This Module can be instantiated again, or shared via postMessage().
WebAssembly.Module
Module
deno versions: 1.12.2 and 1.13.1
main.ts
const worker = new Worker( new URL("./worker.ts", import.meta.url).href, { name: "wasmWorker", type: "module", }, ); const wasmBuf = Deno.readFileSync("./test.wasm",); const valid = WebAssembly.validate(wasmBuf); console.log("valid", valid); // => true WebAssembly.compile(wasmBuf).then((mod) => { console.log("sending module to worker"); worker.postMessage({ "module": mod }); }).catch((err) => { console.log(err); });
worker.ts
onmessage = function (e) { console.log("module received from main thread"); console.log(e.data); };
Result
➜ deno run -A test.ts valid true sending module to worker DOMException: Failed to serialize response
Note that in the context this minimal example is based on, the message is DataCloneError: Failed to serialize response
DataCloneError: Failed to serialize response
The text was updated successfully, but these errors were encountered:
v8::CompiledWasmModule
feat: Support serializing WebAssembly.Module objects
fb91884
Closes denoland#11823.
lucacasonato
Successfully merging a pull request may close this issue.
related to #9140, which was closed as structured cloning had not yet been implemented.
Now that #3557 has been implemented, I would expect the following to work given the following documentation:
deno versions: 1.12.2 and 1.13.1
main.ts
worker.ts
Result
Note that in the context this minimal example is based on, the message is
DataCloneError: Failed to serialize response
The text was updated successfully, but these errors were encountered: