Closed Bug 1636769 Opened 2 months ago Closed 2 months ago

TypeError: "can't access property "setOption", cm is undefined"

Categories

(DevTools :: Netmonitor, defect, P1)

defect

Tracking

(firefox-esr68 unaffected, firefox76 wontfix, firefox77 verified, firefox78 verified)

VERIFIED FIXED
Firefox 78
Tracking Status
firefox-esr68 --- unaffected
firefox76 --- wontfix
firefox77 --- verified
firefox78 --- verified

People

(Reporter: valentin, Assigned: bomsy)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Thank you for helping make Firefox better. If you are reporting a defect, please complete the following:

What were you doing?

I was debugging bug 1636366 comment 0 - loading the page while clearing the cache several times (ctrl-shift-delete), then looking at the network responses.

I was going up and down through network requests, using the Up and Down keyboard keys, then decided to use PgUp/PgDn

What happened?

Netmonitor became white, and this was printed in the browser console:

TypeError: "can't access property "setOption", cm is undefined"
    setOption resource://devtools/client/shared/sourceeditor/editor.js:1299
    setMode resource://devtools/client/shared/sourceeditor/editor.js:557
    updateEditor resource://devtools/client/netmonitor/src/components/previews/SourcePreview.js:92
    componentDidUpdate resource://devtools/client/netmonitor/src/components/previews/SourcePreview.js:53
    React 36
    bootstrap resource://devtools/client/netmonitor/src/app.js:77
    open resource://devtools/client/netmonitor/panel.js:20
    onLoad resource://devtools/client/framework/toolbox.js:2522
react-dom.js:12769:13
TypeError: can't access property "setOption", cm is undefined
editor.js:1299:7

Thanks for the report Valentin!

What Firefox version were you using and what OS?

Also, do you have some STR we could follow? Simply trying to use Page Up/Down on cnn.com doesn't seem to show the problem.

Honza

Flags: needinfo?(valentin.gosu)

I'm using PopOS - a Ubuntu variant.
Firefox 78.0a1 (2020-05-10) (64-bit)

I'll try to find some better STR if I can reproduce it again.

Flags: needinfo?(valentin.gosu)

Valentin, would you know if you had the first Headers open, or Request or Response?

Flags: needinfo?(valentin.gosu)

(In reply to :Harald Kirschner :digitarald from comment #3)

Valentin, would you know if you had the first Headers open, or Request or Response?

Excellent question. It actually made me reproduce it again.

STR:

  1. Go to google.com
  2. Open netmonitor, refresh, select the Response panel.
  3. input a search term - you don't necessarily have to hit enter
  4. Go up and down with the arrow keys, then with PgUp/PgDn several times
  5. Usually when hitting PgDn (probably when reaching the end of the list) the entire devtools turns blank.

I've reproduced it 5/5 times.

Flags: needinfo?(valentin.gosu)

Here's a screen cast and what was printed in the browser console:

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“default-src”). panel.js:78:24
TypeError: "can't access property "setOption", cm is undefined"
    setOption resource://devtools/client/shared/sourceeditor/editor.js:1299
    setMode resource://devtools/client/shared/sourceeditor/editor.js:557
    updateEditor resource://devtools/client/netmonitor/src/components/previews/SourcePreview.js:92
    componentDidUpdate resource://devtools/client/netmonitor/src/components/previews/SourcePreview.js:53
    React 12
react-dom.js:12769:13
TypeError: can't access property "setOption", cm is undefined
editor.js:1299:7
    setOption resource://devtools/client/shared/sourceeditor/editor.js:1299
    setMode resource://devtools/client/shared/sourceeditor/editor.js:557
    updateEditor resource://devtools/client/netmonitor/src/components/previews/SourcePreview.js:92
    componentDidUpdate resource://devtools/client/netmonitor/src/components/previews/SourcePreview.js:53
    React 12
    dispatchInteractiveEvent self-hosted:891
Webconsole context has changed

Thanks for the video Valentin!

I was able to reproduce this on my machine.

TypeError: can't access property "setOption", cm is undefined editor.js:1299:7

The above error occurred in the <SourcePreview> component:
    in SourcePreview
    in VisibilityHandler
    in Unknown (created by Connect(Component))
    in Connect(Component) (created by bound createElementWithValidation)
    in bound createElementWithValidation (created by Accordion)
    in div (created by Accordion)
    in li (created by Accordion)
    in ul (created by Accordion)
    in Accordion (created by ResponsePanel)
    in div (created by ResponsePanel)
    in ResponsePanel (created by TabboxPanel)
    in div (created by Panel)
    in Panel (created by TabboxPanel)
    in div (created by Tabs)
    in div (created by Tabs)
    in div (created by Tabs)
    in Tabs (created by Sidebar)
    in Sidebar (created by Tabbar)
    in div (created by Tabbar)
    in Tabbar (created by TabboxPanel)
    in TabboxPanel (created by NetworkDetailsBar)
    in div (created by NetworkDetailsBar)
    in NetworkDetailsBar
    in VisibilityHandler
    in Unknown (created by Connect(Component))
    in Connect(Component) (created by MonitorPanel)
    in div (created by SplitBox)
    in div (created by SplitBox)
    in SplitBox (created by MonitorPanel)
    in div (created by MonitorPanel)
    in MonitorPanel
    in VisibilityHandler
    in Unknown (created by Connect(Component))
    in Connect(Component) (created by App)
    in div (created by DropHarHandler)
    in DropHarHandler (created by App)
    in div (created by App)
    in App
    in VisibilityHandler
    in Unknown (created by Connect(Component))
    in Connect(Component)
    in Provider

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries. react-dom-dev.js:17252:13

Honza

Severity: -- → S3
Has STR: --- → yes
Priority: -- → P1

Hubert, this should be fixed asap in 78

Honza

Flags: needinfo?(hmanilla)

If this was regressed by bug 1613885 (my first guess, please verify), we should consider uplift?

Keywords: regression
Regressed by: 1613885

Lets mke sure the code mirror instance exists before trying to update the
mode or the text

Assignee: nobody → hmanilla
Status: NEW → ASSIGNED
Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9af370d53fe6
Make sure code mirror instance exists for the update r=Honza
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 78

@harald yes we can probably uplift

Flags: needinfo?(hmanilla)

Comment on attachment 9149617 [details]
Bug 1636769 - Make sure code mirror instance exists for the update r=honza

Beta/Release Uplift Approval Request

  • User impact if declined: impacts only developers, breaks the devtools ui when there is no code mirror instance
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Only affects developers , small patch
  • String changes made/needed:
Attachment #9149617 - Flags: approval-mozilla-beta?

Comment on attachment 9149617 [details]
Bug 1636769 - Make sure code mirror instance exists for the update r=honza

P1 , regression in devtools in 77, small patch verified on nightly, uplift approved for 77 beta 9, thanks!

Attachment #9149617 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Hi!
I was able to reproduce this issue on Nightly 77.0a1 and Beta 77.0b7 on Ubuntu 18.04 and windows 10
Verified-fixed on beta 77.0b9, Nightly 78.0a1 on Ubuntu 18.04 and Windows10.
I'll update flags accordingly.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.