The following example pages decodes a texture in a web worker, transfers the result into the main thread via "postMessage()" and then renders the result on a plane. https://threejs.org/examples/webgl_loader_texture_basis Expected behavior: The texture is always rendered correctly. Actual behavior: Sometimes the plane is white since no texture is applied. This only happens sporadicly (maybe one out of ten reloads). A user at GitHub found out that the root cause of this issue is a missing message from the worker. Meaning the worker sends the message but it never reaches the main thread. https://github.com/mrdoob/three.js/issues/19717#issuecomment-653581829 This issue only happens in WebKit based browsers on iOS, iPadOS and macOS. According to the comments at GitHub the example used to work consistently in earlier version of Safari (meaning < 14).
Thank you for the bug report and the test site. It looks like I can I am able to reproduce on Safari 15 on macOS.
Hmm, I see the page sending 2 messages to the worker and us dispatching those 2 message events on the WorkerGlobalScope. However, I do not see any messages being sent *from* the worker (no WorkerGlobalScope.postMessage() or MessagePort.postMessage() calls).
I don't think this is an issue with postMessage(). The worker simply doesn't call postMessage() to send back the results, even though it received 2 messages from the main thread. So presumably, whatever operation is happening between the worker receiving the messages and the worker calling postMessage() with the results is getting stuck, sometimes.
Since canvas is involved, I tried disabling the GPU process but it didn't help.
The worker definitely calls "postMessage()" at this place: https://github.com/mrdoob/three.js/blob/105bd07ffce14f8f8982417e16b99c0d066ce3f1/examples/jsm/loaders/BasisTextureLoader.js#L418 Interestingly, when I add a console.log() right before this line, you see a console log when the demo works. However, when the plane keeps white (so when the issue appears), there is no log in the console.
Re-titling to say what we know about the issue, as it's been demonstrated to NOT be related to postMessage(), given that the execution doesn't even reach postMessage() in the worker.
<rdar://problem/82814418>
I´m also experiencing this issue. Any news or updates?