hotjar-js
hotjar-js copied to clipboard
Cannot read properties of undefined (reading 'cookie')
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>
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.
We also started seeing this error using the tracking code script, 8 events affecting 6 users today.
We've also started seeing this issue and another seemingly related issue: TypeError: undefined is not an object (evaluating 'this.cookie')
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.