BuilderIO / partytown

Relocate resource intensive third-party scripts off of the main thread and into a web worker. 🎉
https://partytown.builder.io
MIT License
13.04k stars 433 forks source link

(thi$(this)?window:this) #334

Open 6f5 opened 1 year ago

6f5 commented 1 year ago

Problem: When I run the scripts in service worker by partytown, the word "this" in strings gets replaced with "(thi$(this)?window:this)" when logged or outputted to the DOM.

const messages = [
  {
    title: "Title",
    body: "I liked this product"
  }
]; 

console.log(messages[0].body); // "I liked (thi$(this)?window:this) product"
reefnetalex commented 1 year ago

I can confirm this is still a live issue. It affected text in a popup I was running on a client's site that used PartyTown. The popup "decline" button was supposed to read "Not This Time" and instead read "Not (thi$(this)?window:this) time".

dwainscheeren commented 1 month ago

Same error here, what is the fix? image