3DStreet / 3dstreet

🚲🚶🚌 Web-based 3D visualization of streets using A-Frame
https://3dstreet.app
Other
249 stars 30 forks source link

posthog runtime errors #563

Open kfarr opened 3 weeks ago

kfarr commented 3 weeks ago

had to disable posthog for local dev because it raises uncaught runtime errors. perhaps the official react version would be better?

image

rahulkgupta commented 3 weeks ago
Screenshot 2024-06-06 at 8 07 16 PM Screenshot 2024-06-06 at 8 08 06 PM

very odd. im moving things around and clicking and not able to repro. I'm on add-posthog branch and am running things with npm start. im on http://localhost:3333/#/scenes/f9795da3-6292-415c-8109-e3a9ca1a8a2d.json

vincentfretin commented 3 weeks ago

The collecting data for the session replay feature seems to be rather aggressive.

sessionrecording.ts:789 Uncaught TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'd'
    |     property 'components' -> object with constructor 'Object'
    |     property 'position' -> object with constructor 'n'
    --- property 'el' closes the circle
    at JSON.stringify (<anonymous>)
    at e.value (sessionrecording.ts:789:27)
    at emit (sessionrecording.ts:683:22)
    at ht (index.js:108:57)
    at le (index.js:138:9)
    at He.e.mutationCb (observer.js:731:19)
    at e.emit (mutation.js:308:18)
    at e.processMutations (mutation.js:107:18)

in sessionrecording.ts:789:27 const size = JSON.stringify(event).length it stringify the event probably the mouseenter or click event on the canvas and try to serialize the cameraRig entity where we have the cursor-teleport component, and an aframe entity has object3D and the again el a reference to the aframe entity.

vincentfretin commented 3 weeks ago

We should see if we can just disable the session replay feature.

rahulkgupta commented 3 weeks ago

gotcha, will try the other way. session replay is a key feature IMO to understand how the user is using the product

vincentfretin commented 3 weeks ago

That should be fixed by https://github.com/PostHog/posthog-js/pull/1230

fyi the issue was triggered by this code https://github.com/3DStreet/3dstreet/blob/01929dd62c39eed52dc79b41a1f7489b7c29fad6/src/components/screentock.js#L31-L43 with the removeAtttribute('cursor-teleport') and then the setAttribute('cursor-teleport', ...) that is called to take a screenshot when you click on Share button, so that triggers the serialization of what DOM attributes changed because of the Share click event.