Closed Bug 1457330 Opened Last year Closed Last year

TypeError: quads is undefined

Categories

(DevTools :: General, defect, P3)

defect

Tracking

(firefox61 wontfix, firefox62 wontfix, firefox63 wontfix, firefox64 fixed)

RESOLVED FIXED
Firefox 64
Tracking Status
firefox61 --- wontfix
firefox62 --- wontfix
firefox63 --- wontfix
firefox64 --- fixed

People

(Reporter: osmose, Assigned: miker)

References

()

Details

(Whiteboard: [nightly-js-sentry:2055947][nightly-js-sentry:4606437])

Attachments

(1 file)

This bug was automatically filed from Sentry: https://sentry.prod.mozaws.net/operations/nightly-js-errors/issues/2055947/

TypeError: quads is undefined

This has about 32k occurrences on Sentry. The only places I can find variables named "quads" in JS code is in the devtools[1], which makes sense, as devtools errors are unsampled currently.

Interestingly, this has no traceback. I don't know why, but figuring out what is causing this error to be reported without a traceback would be very helpful for bug 1452798.

[1] https://searchfox.org/mozilla-central/search?q=quads&path=*.js
Thanks for filing. This variable is most likely set as a result of calling node.getBoxQuads, which is a geometry DOM API we use often in the inspector. We use it in many places though, so without a traceback, it'll be hard to know which one is causing this error and why. Moving to the inspector component for now.
Component: Developer Tools → Developer Tools: Inspector
Product: Firefox → DevTools
Priority: -- → P3
Since I originally filed this, I've learned that devtools errors without tracebacks have file info in the JSON view of an error.

This error is coming from resource://devtools/server/actors/highlighters/box-model.js. There's only one use of `quads.length` in that file: https://searchfox.org/mozilla-central/source/devtools/server/actors/highlighters/box-model.js#416

It looks like we recently updated the text for errors from accessing attributes on undefined, and https://sentry.prod.mozaws.net/operations/nightly-js-errors/issues/4606437/ is the same error with a different message.

The rate of that error is increasing pretty rapidly, from 2000 a day to 5000 a day in the past three days. The original error was fluctuating between 3000 and 6000 occurrences a day, but will probably die down as clients update to the new error messaging.
Component: Inspector → General
Whiteboard: [nightly-js-sentry:2055947] → [nightly-js-sentry:2055947][nightly-js-sentry:4606437]
Thanks for investigating Michael. Looks like this is indeed the line of code that needs to be fixed.
The function already has an early return for cases where quads.length is falsy. So I think we should also have one for cases where quads is not even defined.
Now, in theory there should never be such a case. The list of quads is reset when the box-model highlighter is hidden. And when it's hidden we shouldn't be trying to show it again.
It could be a race condition. Or simply a missing return condition in one of the other functions.
But unless we can reproduce this error consistently locally, it will be hard to find the actual root cause. So adding the early return if quads is undefined could be a good stop gap measure against this frequent error.

Mike, since you're working on highlighters at the moment, do you mind taking a look at this one?
Flags: needinfo?(mratcliffe)
Assignee: nobody → mratcliffe
Status: NEW → ASSIGNED
Flags: needinfo?(mratcliffe)
When Firefox is closing the whole browser is getting torn down so it would not surprising that it is throwing this error if we are inspecting code at the time.
Just added a little more caution to the box model highlighter when getting quads.
Comment on attachment 9008032 [details]
Bug 1457330 - TypeError: quads is undefined

Patrick Brosset <:pbro> has approved the revision.
Attachment #9008032 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/d0bc39688caa
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
Is this something we should consider for Beta backport or can it ride the trains?
Flags: needinfo?(mratcliffe)
(In reply to Ryan VanderMeulen [:RyanVM] from comment #10)
> Is this something we should consider for Beta backport or can it ride the
> trains?

It is not a new problem so it can ride the trains.
Flags: needinfo?(mratcliffe)
You need to log in before you can comment on or make changes to this bug.