From dd45cd4ef91e897e69c01d417d17341634ce4f41 Mon Sep 17 00:00:00 2001 From: Frank Noirot Date: Fri, 7 Mar 2025 14:09:56 -0500 Subject: [PATCH] Don't try to clone a THREE.js group in coredump (#5690) Fixes #5117 by just grabbing the `userData` off the group, and not trying to clone the whole class instance which errors. --- src/lib/coredump.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/coredump.ts b/src/lib/coredump.ts index 00ff4aad7..32159d662 100644 --- a/src/lib/coredump.ts +++ b/src/lib/coredump.ts @@ -349,8 +349,19 @@ export class CoreDumpManager { sceneEntitiesManager?.activeSegments ) if (sceneEntitiesManager?.activeSegments) { + // You can't structuredClone a THREE.js Group, so let's just get the userData. ;(clientState.scene_entities_manager as any).activeSegments = - structuredClone(sceneEntitiesManager.activeSegments) + Object.entries(sceneEntitiesManager.activeSegments).map( + ([id, segmentGroup]) => ({ + segmentId: id, + userData: + segmentGroup && + typeof segmentGroup === 'object' && + 'userData' in segmentGroup + ? segmentGroup.userData + : null, + }) + ) } }