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
While i was trying to load ml5 via a webworker I am getting an error message due to absence of window. Since webworkers provide an isolated environment it has no access to window or other web apis. Isn't there a way to make it export without being dependent on window object. I am using a K-means classifier but it freezes the browser for 2-7 secs dependent on the case. Initial idea was using a webworker to prevent freezing of UI Thread. Do you have any suggestion or a work around for this?
β Step 2: Screenshots or Relevant Documentation πΌ
Error due to absence of window inside web worker
β Step 3: Share an example of the issue π¦
Trying to import like this using webpack. Imports work fine with other libraries such as antd ml-worker.js
importml5from'ml5';self.onmessage=({data: { question }})=>{console.log(question);console.log(ml5.version);self.postMessage({answer: 1,// TODO: replace with ml5});};exportdefaultnull;
β Describe your setup π¦
Here's some helpful information about my setup...
Chrome Version 107.0.5304.110 (Official Build) (arm64):
macos big sur 11.6.5:
ml5: 0.12.2:
The text was updated successfully, but these errors were encountered:
orabazu
changed the title
Webworker imports generate error because of absence ofwindow
Webworker imports generate error because of absence of windowNov 20, 2022
πHey ml5 community π
β Step 1: Describe the issue π
While i was trying to load
ml5
via a webworker I am getting an error message due to absence ofwindow
. Since webworkers provide an isolated environment it has no access to window or other web apis. Isn't there a way to make it export without being dependent onwindow
object. I am using a K-means classifier but it freezes the browser for 2-7 secs dependent on the case. Initial idea was using a webworker to prevent freezing of UI Thread. Do you have any suggestion or a work around for this?β Step 2: Screenshots or Relevant Documentation πΌ
Error due to absence of window inside web worker
β Step 3: Share an example of the issue π¦
Trying to import like this using webpack. Imports work fine with other libraries such as
antd
ml-worker.js
β Describe your setup π¦
The text was updated successfully, but these errors were encountered: