New issue
Advanced search Search tips

Issue 876265 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Source Tab is blank

Reported by austin.f...@gmail.com, Aug 21

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

Steps to reproduce the problem:
1. Go to website
2. Inspect
3. Click Source

What is the expected behavior?
Show Sources

What went wrong?
Uncaught (in promise) TypeError: Cannot read property 'length' of undefined
    at new Sources.TabbedEditorContainer.HistoryItem (sources_module.js:1134)
    at Function.fromObject (sources_module.js:1135)
    at Function.fromObject (sources_module.js:1139)
    at new Sources.TabbedEditorContainer (sources_module.js:1057)
    at new Sources.SourcesView (sources_module.js:1306)
    at new Sources.SourcesPanel (sources_module.js:1448)
    at Runtime.sharedInstance (shell.js:78)
    at Runtime.Extension._createInstance (shell.js:107)
sources_module.js:1488 Uncaught (in promise) TypeError: Cannot read property 'showSourceLocation' of undefined
    at Sources.SourcesPanel.showUISourceCode (sources_module.js:1488)
    at Sources.SourcesPanel.showUILocation (sources_module.js:1491)
    at Sources.SourcesPanel.UILocationRevealer.reveal (sources_module.js:1600)
    at reveal (shell.js:896)
3sources_module.js:1134 Uncaught (in promise) TypeError: Cannot read property 'length' of undefined
    at new Sources.TabbedEditorContainer.HistoryItem (sources_module.js:1134)
    at Function.fromObject (sources_module.js:1135)
    at Function.fromObject (sources_module.js:1139)
    at new Sources.TabbedEditorContainer (sources_module.js:1057)
    at new Sources.SourcesView (sources_module.js:1306)
    at new Sources.SourcesPanel (sources_module.js:1448)
    at Runtime.sharedInstance (shell.js:78)
    at Runtime.Extension._createInstance (shell.js:107)

Did this work before? Yes 

Chrome version: 68.0.3440.106  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: 

Working in chrome 67 on MacOS
Working in chrome 68 on Windows 10
No extensions installed in the version that is failing.
 
Labels: Needs-Triage-M68 Needs-Bisect
Cc: swarnasree.mukkala@chromium.org
Labels: Triaged-ET Needs-Feedback
Unable to reproduce the issue on reported chrome version #68.0.3440.106 using Windows 10 by followimg below steps.

Ateps:
=====
1.Launched chrome.
2.Navigated to facebook.com.
3.Right clicked on the mouse, selected inspect.
4.Opened Sources observed the source files under source tab.

Attached screencast for reference.

@Reporter: Could you please review the attached screen-cast and confirm if anything being missed here and request you to retry this issue with fresh profile without any extensions/apps or reset all the flags and let us know if issue still persists.

Thanks.!
876265.mp4
3.8 MB View Download

Comment 3 Deleted

Project Member

Comment 4 by sheriffbot@chromium.org, Aug 24

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
You are using windows 10, as indicated, its working on windows 10.

It's a windows 7 machine it isn't working on.
I presume from the stack trace, this is where it goes wrong, with url being undefined.

https://github.com/ChromeDevTools/devtools-frontend/blob/master/front_end/sources/TabbedEditorContainer.js#L628

/** @const */ this._isSerializable =
        url.length < Sources.TabbedEditorContainer.HistoryItem.serializableUrlLengthLimit;

And ultimately because of

https://github.com/ChromeDevTools/devtools-frontend/blob/master/front_end/sources/SourcesView.js#L29

Common.settings.createLocalSetting('previouslyViewedFiles', [])

returning a list with an entry that doesn't have a url.

Could it be a corrupt or very old profile? The machine having the issue has not been used in a year or two.


Indeed localStorage.previouslyViewedFiles is an array who's first entry is an empty url

    {  
      "url":"",
      "selectionRange":{  
         "startLine":1,
         "startColumn":0,
         "endLine":1,
         "endColumn":0
      },
      "scrollLineNumber":4117
   },

and later several other entries (probably the culprits) that have no url field at all, they all look like this

   {  
      "selectionRange":null
   },
  

Finally, doing localStorage.previouslyViewedFiles = [] has allowed the source view to open.
I would suggest the issue is that at some point it was the norm to have empty entries in the list, but at some later point the assumption that all entries are not empty was introduced perhaps because empty entries are removed, which in exceptional cases (e.g. coming back to a machine two years later) is not the case.

Happy that this is closed as wont-fix because its probably such an unusual and rare case that it is likely not to happen again.
Owner: einbinder@chromium.org
Status: Assigned (was: Unconfirmed)
Labels: -Needs-Bisect
Unable to reproduce the issue on reported chrome version #68.0.3440.106 using Windows 7 by following below steps.

Steps:
=====
1.Launched chrome.
2.Navigated to facebook.com.
3.Right clicked on mouse and clicked on inspect.
4.Opened source tab, observed source files under source tab.

Attached screencast for reference.
As the issue is not getting reproduced from TE end hence removing Needs-Bisect label. Requesting anyone from         
Platform>DevTools to look into the issue.

Thanks.!
876265(3).mp4
1.0 MB View Download
re comment 11

well no, you won't have the issue, because as explained in comment 8, it happened when there are empty entries in `localStorage.previouslyViewedFiles`

I doubt the fact it was windows 7 is significant, the significant part is that it was a machine that I had come back to after two years with what I presume is an out of date data structure.

Indeed I can reproduce easily on a different machine as follows:

1. Inspect a page
2. Select Elements
3. Close dev tools
4. Inspect a page
5. Press Ctrl+Shift+I
6. In console, type (this simulates what was in previouslyViewedFiles)

localStorage.previouslyViewedFiles = JSON.stringify((function(a){ a.push({ selectionRange: null }); return a; })(JSON.parse(localStorage.previouslyViewedFiles)))

7. Close both devtool windows
8. Inspect a page
9. Click Sources (it will be blank)
10. Ctrl+Shift+I
11. In console, you will see the following error

Uncaught (in promise) TypeError: Cannot read property 'length' of undefined
    at new Sources.TabbedEditorContainer.HistoryItem (sources_module.js:1134)
    at Function.fromObject (sources_module.js:1135)
    at Function.fromObject (sources_module.js:1139)
    at new Sources.TabbedEditorContainer (sources_module.js:1057)
    at new Sources.SourcesView (sources_module.js:1306)
    at new Sources.SourcesPanel (sources_module.js:1448)
    at Runtime.sharedInstance (shell.js:78)
    at Runtime.Extension._createInstance (shell.js:107)

100% reproducible.

To repair your devtools, in console, enter

localStorage.previouslyViewedFiles = "[]"

close and reopen devtools.

Sign in to add a comment