yesterday returned to my hobby with HTML canvas and tried to do a rendering in a separate thread, just to face the following error in the console:
Uncaugh
You should send OffscreenCanvas to worker only once:
worker.postMessage({canvas: offscreenCanvas}, [offscreenCanvas]); while (dTime > timeProduct) { worker.postMessage({ posX, posY }); dTime -= timeProduct; }