clarity icon indicating copy to clipboard operation
clarity copied to clipboard

Clarity 0.7.43 breaks partytown integration

Open lampask opened this issue 6 months ago • 6 comments

Describe the bug New mediaInsertRule (and mediaDeleteRule) breaks clarity deployment inside webworker. We are running clarity through partytown and CSSMediaRule is undefined there, accessing it results in error printed to console.

This is only present in version 0.7.43, where the rules first appear. Previously version 0.7.41 ran without any issues.

TypeError: CSSMediaRule is undefined
    _a https://www.clarity.ms/s/0.7.43/clarity.js:4
    start https://www.clarity.ms/s/0.7.43/clarity.js:4
    pi https://www.clarity.ms/s/0.7.43/clarity.js:4
    Ui https://www.clarity.ms/s/0.7.43/clarity.js:4
    Ui https://www.clarity.ms/s/0.7.43/clarity.js:4
    Ji https://www.clarity.ms/s/0.7.43/clarity.js:4
    Gi https://www.clarity.ms/s/0.7.43/clarity.js:4
    anonymous https://www.clarity.ms/s/0.7.43/clarity.js:4
    anonymous https://www.clarity.ms/s/0.7.43/clarity.js:4
    run http://localhost:5173/~partytown/debug/partytown-ww-sw.js?v=0.10.2:713
    receiveMessageFromSandboxToWorker http://localhost:5173/~partytown/debug/partytown-ww-sw.js?v=0.10.2:1811
    receiveMessageFromSandboxToWorker http://localhost:5173/~partytown/debug/partytown-ww-sw.js?v=0.10.2:1819

Repro Steps

  1. Setup project with partytown
  2. Add clarity snippet in script tag with type="text/partytown"

lampask avatar Aug 06 '24 16:08 lampask