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
Earlier, I have successfully integrated a single-threaded emscripten-based WASM app in a React application (invoking the WASM app(Module) from a useEffect() call). Rendering works on the canvas as expected.
After switching on multi-threading (-pthread, PROXY_TO_PTHREAD, OFFSCREENCANVAS_SUPPORT) for accelerated rendering, the app still starts when viewing it via a hand-crafted index.html that includes app.js, defines the Module and its canvas and calls the app(Module)... and the canvas gets filled as expected.
However with multi-threading the exact same code does not work in a React application in a startup useEffect() call results in an error event "Pthread 0x01519128 sent an error! undefined:undefined: undefined" triggered in loadWasmModuleToWorker. Interestingly, when compiling the app even with a minimum thread pool size of two "SHELL:-s PTHREAD_POOL_SIZE=2", the app does not start at all: "waiting for dependencies, dependencies: workers" is repeated every couple of seconds in the console.
Any hints how to solve this issue or ideas how this happens? It seems strange to me since React does not do anything with threads.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Earlier, I have successfully integrated a single-threaded emscripten-based WASM app in a React application (invoking the WASM app(Module) from a useEffect() call). Rendering works on the canvas as expected.
After switching on multi-threading (-pthread, PROXY_TO_PTHREAD, OFFSCREENCANVAS_SUPPORT) for accelerated rendering, the app still starts when viewing it via a hand-crafted index.html that includes app.js, defines the Module and its canvas and calls the app(Module)... and the canvas gets filled as expected.
However with multi-threading the exact same code does not work in a React application in a startup useEffect() call results in an error event "Pthread 0x01519128 sent an error! undefined:undefined: undefined" triggered in loadWasmModuleToWorker. Interestingly, when compiling the app even with a minimum thread pool size of two "SHELL:-s PTHREAD_POOL_SIZE=2", the app does not start at all: "waiting for dependencies, dependencies: workers" is repeated every couple of seconds in the console.
Any hints how to solve this issue or ideas how this happens? It seems strange to me since React does not do anything with threads.
Beta Was this translation helpful? Give feedback.
All reactions