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.05k stars 433 forks source link

[🐞] Partytown doesn't work with Chatwoot #515

Open FRNDLab opened 10 months ago

FRNDLab commented 10 months ago

Describe the bug

In the video, I create a chatwoot instance, and then I execute $chatwoot.toggle(); to show it.

The widget is transparent because partytown modify iframe.

https://github.com/BuilderIO/partytown/assets/102629955/d42b1518-d5d2-4fbc-a872-52dd312d7712

I think the problem is in iframe

with partytown image

without partytown image

NUXT 3

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  devtools: { enabled: true },
  modules: [
    "nuxt-purgecss",
    "@nuxt/image",
    "@nuxtjs/partytown",
    "@productdevbook/chatwoot",
  ],
  partytown: {
    debug: true,
    forward: [
      "chatwootSDK.run",
      "chatwootSDK.run",

      "$chatwoot.toggle",
      "$chatwoot.toggle",

      "$chatwoot.isOpen",
      "$chatwoot.isOpen",

      "$chatwoot.websiteToken",
      "$chatwoot.websiteToken",
    ],
  },

.....

  chatwoot: {
    init: {
      websiteToken: "exampleToken",
      baseUrl: "https://chat.hostname.com",
    },
    // If this is loaded you can make it true, https://github.com/nuxt-modules/partytown
    partytown: true,
  },
});

Reproduction

N/A

Steps to reproduce

N/A

Browser Info

Edge

Additional Information

partytown 0.8.1

gioboa commented 10 months ago

Hi @mariofernandu, can you create a specific test in the codebase to reproduce this case pls? A vanilla JS one will be awesome, thanks

FRNDLab commented 10 months ago

Hi @mariofernandu, can you create a specific test in the codebase to reproduce this case pls? A vanilla JS one will be awesome, thanks

Hi thanks for your time and help

You can download the code of the test here

https://issue515.clotrservers.com/partytown-issue-515.zip

and view live here:

https://issue515.clotrservers.com/index.html