Open qdwang opened 5 months ago
setting mainScriptUrlOrBlob
to the url of libxxx.js
can solve this issue
You should not need to set mainScriptUrlOrBlob
just to make this work.
Can I ask you, were you setting mainScriptUrlOrBlob
to something else prior to this fix?
Please include the following in your bug report:
Version of emscripten/emsdk:
Failing command line in full: No failing command.
Full link command and output with
-v
appended:-pthread -sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency -O3 -flto -sENVIRONMENT="web, worker" -sFILESYSTEM=0 -sALLOW_MEMORY_GROWTH -sEXPORT_NAME=libxxx -sMODULARIZE
This will generate three files:
libxxx.js
,libxxx.wasm
,libxxx.worker.js
. If I directly uselibxxx.js
in<script src="libxxx.js"></script>
, the C function works but it will block the UI thread. If I try to importlibxxx.js
by usingimportScripts("libtinydng.js");
in a custom worker file, it won't work also.-sEXPORT_NAME=libxxx -sMODULARIZE
, it will cause an error on thelibxxx.worker.js
:Uncaught TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed.
-sEXPORT_NAME=libxxx -sMODULARIZE
, the custom worker file will be loaded multiple times and multithreading just stop working.