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

Cannot read properties of undefined (reading 'cookie')

Open weilinzung opened this issue 1 year ago • 4 comments

We are keeping getting the below undefined errors

"@hotjar/browser": "^1.0.9",
import Hotjar from '@hotjar/browser';


....

Hotjar.init(xxxx(hotjarId), 6);



TypeError Cannot read properties of undefined (reading 'cookie') 
    https://script.hotjar.com/modules.7532ebbcfaf7feae351e.js:1:7384 u.clear
    https://script.hotjar.com/modules.7532ebbcfaf7feae351e.js:1:10288 
    node_modules/.pnpm/[email protected]/node_modules/zone.js/fesm2015/zone.js:2355:40 Y.<computed>
    node_modules/.pnpm/[email protected]/node_modules/zone.js/fesm2015/zone.js:402:30 m.invokeTask
    node_modules/.pnpm/[email protected]/node_modules/zone.js/fesm2015/zone.js:171:46 a0.runTask
    node_modules/.pnpm/[email protected]/node_modules/zone.js/fesm2015/zone.js:483:33 invokeTask
    node_modules/.pnpm/[email protected]/node_modules/zone.js/fesm2015/zone.js:472:47 invoke
    node_modules/.pnpm/[email protected]/node_modules/zone.js/fesm2015/zone.js:2335:31 h.args.<computed>

weilinzung avatar Sep 20 '23 15:09 weilinzung

We are initializing hotjar in our app with the hotjar js script. Getting the same cannot read properties of undefined(reading 'cookie') error - fired off over 17k times in the last 24 hours in Sentry.

susantashiro avatar Sep 20 '23 16:09 susantashiro

We also started seeing this error using the tracking code script, 8 events affecting 6 users today.

felipelube avatar Sep 20 '23 22:09 felipelube

We've also started seeing this issue and another seemingly related issue: TypeError: undefined is not an object (evaluating 'this.cookie')

sebammon avatar Sep 21 '23 07:09 sebammon

Same here. And we started to see these errors at 2023-09-19 1:43PM UTC. And worth pointing out is that we have not done any configuration changes nor script version update in conjunction to this.

dannyskoog avatar Sep 21 '23 09:09 dannyskoog