How to solve this problem!
An error occurred while rendering. Rendering has stopped.
DataCloneError: Failed to execute ‘postMessage’ on ‘Worker’: [object Array] could not be cloned.
I also encountered this issue when implementing a mouse movement feature to select a model entity drawn on a map. Please let me know how you solved it. Thank you so much.
There are several answers here that talk about this error. But none of them provides sufficient detail to even make profound guesses about the reason for the error - and even less, for possible solutions.
So I’ll start with a guess that’s based on the CesiumJS code, and totally unrelated to issues that people might have with their setup: Is anybody, by any chance, creating and adding a Primitive with something like
My issue is that when we use the function scene.pick or scene.drillPick during the mouse moving, those “Worker” errors occurred. That means the picking function is called too much at the short time.
If I remove that mouse hover event or not using scene.pick, scene.drillPick, no issue happens however that’s our fundamental function which cannot be excluded.
Some ideas such as using throttle, debounced to reduce the actions however it’s not only not resolving the problems but also making our features working incorrectly.
So, please kindly share with me any other idea to resolve this issue if you have.
There seems to be a problem that affects multiple people. But until now, I did not see a reasonable way to reproduce the error. If you can provide a https://sandcastle.cesium.com/ where you can call drillPick and see the error, then it might be possible to analyze that and figure out what is wrong.
Or to put it that way: The Sandcastle at Cesium Sandcastle already does use drillPick, and it works. So we have to figure out what is different compared to the case where the error appears.