Skip to content

Multithreaded app in React does not start #23499

Answered by sophonet
sophonet asked this question in Q&A
Discussion options

You must be logged in to vote

Update: When placing a second copy of app.js not only for bundling, but also in react's public directory for being used by the WebWorker initialization and defining its name in the Module definition as mainScriptUrlOrBlob, the app is running.

Obviously this is not clean since the main app() function initializing the module is downloaded twice, once in the code of the bundler for react (vite / webpack) and once for the worker from it's vanilla emcc output app.js. I have seen that Blobs can also be passed as URL to workers, but the Blob also needs to include the whole code of app.js, correct?

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@sophonet
Comment options

@kripken
Comment options

@sophonet
Comment options

@sophonet
Comment options

Answer selected by sophonet
@sbc100
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants