Closed dr-matt closed 1 year ago
I imagine it could be that wasm workers might not yet be tested with MODUARLIZE
and/or EXPORT_ES6
. Does your example work if you don't use those options?
@sbc100 you may be right. Without MODULARIZE
the behavior is the same, though I think that flag may be internally enabled if EXPORT_ES6
is turned on. Removing both flags and modifying how the module is loaded and called, the example does work as expected.
So perhaps wasm workers do not currently work properly with EXPORT_ES6
- is this already a known issue?
edit: #17664
Yes EXPORT_ES6 sets MODULARIZE internally.
And yes this looks like a dupe of #17664. Closing as duplicate.
I can't seem to get wasm workers running, even in a simplified and isolated example. Briefly, the browser (most recent chrome and edge) outputs the following error:
When the emscripten-generated worker
thread-test.ww.js
tries to callimportScripts()
to import the main emscripten-generated filethread-test.js
, the above problem is triggered.More details below; please let me know what other information would be helpful.
Version of emscripten/emsdk:
Full link command and output with
-v
appended: (note: this was run indirectly using emcmake)The c++ code in
thread-test.cpp
is adapted from the wasm workers hello world example:Simple usage in an html file: