marker-io / browser-sdk

Marker.io browser SDK
MIT License
9 stars 9 forks source link

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'id') #40

Open MatthewAry opened 3 months ago

MatthewAry commented 3 months ago

Just trying to use Marker and the API and I got this error. It shows up on page load intermittently suggesting its possibly some kind of async race condition.

image image

I'm tracking this back to when I try to call setReporter and I think that I am calling setReporter in my state manager before the Marker Widget is ready for me to call it. Yet, the error is getting emitted for Marker's code so the fix should be on your end.

As for writing code to check if setReporter is safe for me to call; I don't want to, and shouldn't have to wrap a call to setReporter in an marker's on event handler method because that is not an acceptable workaround for bunch of reasons that I don't want to get into.

Thank you!

Sj0nni commented 1 month ago

I have the same issue. Any news about this?

4.v2.12.0.5ad2def….js:1 Uncaught (in promise) 
TypeError: Cannot read properties of null (reading 'id')
    at f.updateAnonymousUserAttributes (4.v2.12.0.5ad2defefb…2eab5ba3.js:1:91450)
    at Array.<anonymous> (3.v2.12.0.ce4fa6c….js:1:6111)
    at f.dispatch (3.v2.12.0.ce4fa6c….js:7:1047)
    at f.dispatch (3.v2.12.0.ce4fa6c….js:1:3342)
    at Object.setReporter (4.v2.12.0.5ad2defefb…2eab5ba3.js:1:19680)