Hotjar support available in Lit 2.x? #2265
-
My team (Carbon for IBM.com Web Components / Carbon Web Components) is currently on lit-element/lit-html, and currently roadmapping our upgrade to Lit 2.x along with other major version upgrade tasks on our plate. One of the issues we are noticing is that Hotjar (https://help.hotjar.com/hc/en-us/articles/115012499507-Platforms-and-Frameworks-not-Compatible-with-Hotjar) doesn't appear to work (CSS isn't rendering in heatmap screenshots) and is a tool that our data analyst teams use extensively for analyzing our website traffic. Anyone know if Hotjar works with Lit 2.x? Or is there something we can do on our end that can get it working on existing lit-element/lit-html? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
The long-term solution is for Hotjar to implement support for constructable stylesheets. Meanwhile, you can force Lit not to use constructable stylesheets by including a script tag like this in the page before loading Lit:
It's kind of gross, but it means we don't need to add configuration complexity to the Lit API and it does exactly what you need to do to make Hotjar work. |
Beta Was this translation helpful? Give feedback.
The long-term solution is for Hotjar to implement support for constructable stylesheets.
Meanwhile, you can force Lit not to use constructable stylesheets by including a script tag like this in the page before loading Lit:
<script>delete Document.prototype['adoptedStyleSheets'];</script>
It's kind of gross, but it means we don't need to add configuration complexity to the Lit API and it does exactly what you need to do to make Hotjar work.