הבנת מחזור החיים של אובייקט DOM

Hey Bob :wave:

Your issue is a bit beyond HTML

<script src="https://rumbletalk.com/client/?$MY_OTHER_ID"></script>

This script runs an IIFE, initializes an instance, and stores the instance in the global scope. The global scope is the same for the entire session in Discourse because it’s a single-page application. You can check that with

console.log(RumbleTalkChat)

After the script loads for the first time. So, RumbleTalkChat["$MY_OTHER_ID"] is what the script is complaining about

if (e.RumbleTalkChat[a.hash]) {
  throw new Error("Trying to create a duplicate chat with code: " + a.hash);
}

You can try to remove that instance before the script loads again with something like this

delete RumbleTalkChat["$MY_OTHER_ID"]

Note that it doesn’t contain the ? character.

That said, you’re probably better off if you figure out why the script is loaded multiple times in the first place. I see that the script has an openChat() method that you can call. So loading the script multiple times might not be necessary.

Unfortunately, you’d need to provide more details about where the embed goes and how you’re adding the markup before we can pinpoint the cause.