hotjar-js icon indicating copy to clipboard operation
hotjar-js copied to clipboard

SDK attempting to call localStorage.get() when unavailable

Open mogelbrod opened this issue 1 year ago • 0 comments

We've gotten a significant number of automated error reports from the HJ script loaded through https://static.hotjar.com/c/hotjar-${hotjarId}.js?sv=${window._hjSettings.hjsv}:

Screenshot 2023-08-07 at 13 34 26 (screenshot from Sentry)

This appears to be caused by the SDK attempting to access localStorage when unavailable, such as when in a private/incognito session. The stack trace shows that there is a canUseLocalStorage() check nearby, but it either isn't being called correctly or doesn't handle this edge case.

I couldn't find good place to report this issue to a HJ developer - feel free to point me in the right direction if this is not the place.

mogelbrod avatar Aug 07 '23 11:08 mogelbrod