Error: this._containers is undefined in MarkupView.jsm Line: 327

RESOLVED DUPLICATE of bug 852996

Status

P2
normal
RESOLVED DUPLICATE of bug 852996
6 years ago
8 months ago

People

(Reporter: Optimizer, Unassigned)

Tracking

Trunk

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [backed-out])

Attachments

(1 obsolete attachment)

(Reporter)

Description

6 years ago
After opening and closing the html panel of inspector once, using the latest Nightly build of 1st October, I am getting these errors in my error console:

Timestamp: 10/1/2012 10:40:51 PM
Error: TypeError: this._containers is undefined
Source File: resource:///modules/devtools/MarkupView.jsm
Line: 327

Some mutation observer was not removed upon closing markup view.
Noticed this today while looking for another problem with the Inspector.

I am able to get a bunch of these errors on the Web Console after I close the Inspector so it does seem like we have an observer sticking around.
Dave, could you take a quick look at that?
Flags: needinfo?(dcamp)

Updated

6 years ago
Flags: needinfo?(dcamp)

Updated

6 years ago
Duplicate of this bug: 794902

Comment 4

6 years ago
I found when I do a 
$.get(url, function(data){ 
   $('#mydiv').html(data);
}
and inside this "data" I have more jquery functions, the error occurs.

/**
   * Mutation observer used for included nodes.
   */
  _mutationObserver: function MT__mutationObserver(aMutations)
  {
    for (let mutation of aMutations) {

### here!!!!! this._containers is undefined
      let container = this._containers.get(mutation.target);
###
      if (!container) {
        // Container might not exist if this came from a load event for an iframe
        // we're not viewing.
        continue;
      }
      if (mutation.type === "attributes" || mutation.type === "characterData") {
        container.update();
      } else if (mutation.type === "childList") {
        this._updateChildren(container);
      }
    }
    this._inspector._emit("markupmutation");
  },
importNode is adding a load handler on the root that isn't being removed.
https://mxr.mozilla.org/mozilla-central/source/browser/devtools/markupview/MarkupView.jsm#304

We need to save a reference to MP_watch_contentLoaded and remove it in the destroy function (MarkupView.jsm#625).

Comment 7

6 years ago
I'm seubg a very similar error after upgradeing to 21 on the beta channel:
TypeError: this._containers is undefined @ resource://app/modules/devtools/MarkupView.jsm:330
Assignee: nobody → jryans
Status: NEW → ASSIGNED
OS: Windows 7 → All
Hardware: x86_64 → All
Created attachment 744200 [details] [diff] [review]
Patch v1

This removes the handler on destroy, which prevents the error from being triggered.

I wasn't quite sure how to test this change, but let me know if you have a suggestion.  I've verified that the existing markup view tests pass locally.
Attachment #744200 - Flags: review?(mratcliffe)
Comment on attachment 744200 [details] [diff] [review]
Patch v1

Review of attachment 744200 [details] [diff] [review]:
-----------------------------------------------------------------

Perfect, r+
Attachment #744200 - Flags: review?(mratcliffe) → review+
Whiteboard: [land-in-fx-team]
can this land?
Yes, it's ready to land.
https://hg.mozilla.org/integration/fx-team/rev/70538913a42e

cha cha!

Thanks Ryan. :)
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
Whiteboard: [fixed-in-fx-team] → [backed-out]
Assignee: jryans → nobody
Status: ASSIGNED → NEW
Attachment #744200 - Attachment is obsolete: true
What's the status of this bug?
I attempted a fix a few months back, but it led to further issues and was backed out.

I haven't had time to try again myself, so that's why I unassigned this one.

IIRC, my patch fixed the reported error, but then introduced intermittent testing issues.  For example, with the patch, markup view tests would pass when run independently, but not when run as a group.
Priority: -- → P3
Actually, marking as P2 because this is a verified bug with a verified (but flawed) fix. We should get this fixed and relanded ASAP.
Priority: P3 → P2
any progress on this?
It looks like a similar fix to my attempted patch was made in bug 852996, so this should be taken care of now.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 852996

Updated

8 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.