Open Bug 1590469 Opened 5 years ago Updated 1 year ago

NotSupportedError: 'conversation-browser' has already been defined as a custom element

Categories

(Chat Core :: General, defect)

defect

Tracking

(Not tracked)

People

(Reporter: clokep, Unassigned)

Details

Attachments

(1 file)

Building on tip (40da1ce45af3) I'm getting the following error whenever I select a conversation:

JavaScript error: chrome://chat/content/conversation-browser.js, line 851: NotSupportedError: 'conversation-browser' has already been defined as a custom element

I don't see this on TB70b4, so I think it is a new error.

Will be fixed in bug 1590074 comment #4.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE

Oops, I should have read bug 1590074 comment #4 better which says:
The error of "NotSupportedError: 'conversation-browser' has already been defined as a custom element" seen on the preferences page is not related to this. That is due to the overlay loader and creation of a duplicate about:preferences document.

Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Status: REOPENED → NEW

Magnus -- I'm unsure if the cause of this is the same as bug 1590047, but could the fix also get applied to the conversation-browser element?

Flags: needinfo?(mkmelin+mozilla)

I'll have to look into it.

Assignee: nobody → mkmelin+mozilla

https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=259798a0418c071fa98f2739ee0191986cbce36f

I'm not sure exactly why this happens. It's due to that we get document-element-inserted for chrome://chat/content/conv.html loading (first) and then document-element-inserted for chrome://messenger/content/messenger.xul which will already have the CEs set up. I don't see why it has them, and perhaps there is a bug further down somewhere. Brian, any ideas?

The reason it didn't happen before 1590074 was that "text/html" docs weren't getting CEs loaded.

Flags: needinfo?(mkmelin+mozilla) → needinfo?(bgrinstead)
Status: NEW → ASSIGNED

Shouldn't you early return if window.MozXULElement at the top of your customElements.js file (https://searchfox.org/comm-central/rev/2268dc26e059e6efdc606b0246bed2875120f53b/mail/base/content/customElements.js#10), just like we do with https://searchfox.org/mozilla-central/rev/8a63fc190b39ed6951abb4aef4a56487a43962bc/toolkit/content/customElements.js#14-19. Then you could drop the if (!window.MozXULElement) condition wrapping the subscript load to the toolkit customElements.js, and more importantly you wouldn't re-load your custom elements a second time.

Flags: needinfo?(bgrinstead)

I'm getting a slightly different error:

Uncaught DOMException: CustomElementRegistry.define: 'conversation-browser' has already been defined as a custom element conversation-browser.js:845
    <anonymous> chrome://chat/content/conversation-browser.js:845
    <anonymous> chrome://messenger/content/customElements.js:34
    <anonymous> chrome://messenger/content/customElements.js:37
    openWindowPrompt resource:///actors/PromptParent.jsm:161
    receiveMessage resource:///actors/PromptParent.jsm:108
    openPrompt resource://gre/modules/Prompter.jsm:1246
    openPromptSync resource://gre/modules/Prompter.jsm:1105
    confirmEx resource://gre/modules/Prompter.jsm:1529
    confirmEx resource://gre/modules/Prompter.jsm:305
    ComposeCanClose chrome://messenger/content/messengercompose/MsgComposeCommands.js:6142
    <anonymous> chrome://messenger/content/messengercompose/MsgComposeCommands.js:214

is it the same issue this bug is about, or is it something different?

Severity: normal → S3

Ping?

Assignee: mkmelin+mozilla → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: