Pierre
11/29/2025, 4:53 PMturansky
11/29/2025, 4:58 PMcode generated try to reference apis which are not available in the browserDo you have error stacktrace?
turansky
11/29/2025, 4:59 PMThe worker code is defined in a sub-projectYou should connect Gradle compilation and sync tasks in that case
Pierre
11/29/2025, 6:36 PMPierre
11/29/2025, 6:37 PMturansky
11/29/2025, 6:56 PMI get a TypeError because the code is trying to access document.Do you have this error in production mode?
turansky
11/29/2025, 6:57 PMthere is a later error when trying to build the url of the wasm code to be loaded with an error 'Invalid base URL'Is there code example how you create
Worker ?Pierre
11/29/2025, 7:01 PMDo you have this error in production mode?
I have not tried this in production yet, will try on monday.
Pierre
11/29/2025, 7:07 PMIs there code example how you create Worker ?
We simply do: val worker = Worker('worker-project.js')
turansky
11/29/2025, 7:30 PMFor bundler it should be like this:val worker = Worker('worker-project.js')
val worker = Worker(URL("worker-project.js", import.meta.url))Pierre
11/29/2025, 7:37 PMFor bundler it should be like this:
val worker = Worker(URL("worker-project.js", import.meta.url))
Thanks, will try that on monday and report the result.Pierre
12/01/2025, 2:56 PMFor bundler it should be like this:
val worker = Worker(URL("worker-project.js", import.meta.url))Pierre
12/01/2025, 5:59 PMturansky
12/01/2025, 6:03 PMbut that requires the worker sub-project's output to be embedded in the main UI subproject's produced bundleSeparate chunk for the worker expected
turansky
12/01/2025, 6:03 PM345235347458.jsPierre
12/02/2025, 9:18 AMconfig.target = 'webworker';turansky
12/02/2025, 10:33 AMturansky
12/02/2025, 10:33 AMPierre
12/02/2025, 10:35 AMPierre
12/02/2025, 10:37 AMPierre
12/02/2025, 10:37 AM__webpack_require__.b = document.baseUri || self.location.href;Pierre
12/02/2025, 10:38 AM__webpack_require__.b = self.location + "";