You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some libraries will output WebAssembly as a byte array in a JavaScript file, and attempt to instantiate from that. Since this array could also be constructed dynamically or from external sources, it is classed as code generation and disallowed in the same way that eval and new Function are.
Some libraries will output WebAssembly as a byte array in a JavaScript file, and attempt to instantiate from that. Since this array could also be constructed dynamically or from external sources, it is classed as code generation and disallowed in the same way that
eval
andnew Function
are.The error thrown from
v8/src/objects/contexts.cc#Context::ErrorMessageForWasmCodeGeneration()
isWasm code generation disallowed by embedder
.This sometimes leads to confusion by users or developers of WASM libraries:
Some libraries, like
xxhash-wasm
, now have a specificworkers
export that uses the module rather than instantiating from a buffer:https://github.com/jungomi/xxhash-wasm/blob/5923f26411ed763044bed17a1fec33fee74e47a0/src/index.js#L8
https://github.com/jungomi/xxhash-wasm/blob/5923f26411ed763044bed17a1fec33fee74e47a0/src/index.workerd.js#L3-L4
cc @jasnell
The text was updated successfully, but these errors were encountered: