121

I am doing the Chrome debugging tutorial, using NetBeans and Google Chrome. Everything, including extensions, seems to work correctly, but when I get to section Use the Debugger, I cannot see the html code to insert a breakpoint.

After selecting inspect popup on the browser, it opens in Console, showing nothing, Elements shows popup.html with images added. When I go to Sources, the file popup.html can be opened, but the only line, Line 1, is blank. If I open the js file, the js file is there and can be edited (break pointed).

I am sorry - probably something basic, but I'm not very experienced with this. I've tried reloading and refreshing everything.

FOLLOW-UP: By entering location.reload(true) into the Console prompt, the popup.html file became visible as Source! Why? No idea.

I hope this saves someone the full day I spent stumbling around.

Guy Coder
  • 24,501
  • 8
  • 71
  • 136
DrWhat
  • 2,360
  • 5
  • 19
  • 33

15 Answers15

84

in my case the order helped was

  1. close the blank tab in sources
  2. close dev tools
  3. open dev tools
  4. open the tab in sources(its still blank)
  5. refresh page
Andrey Zausaylov
  • 1,015
  • 7
  • 7
65

This appears to be a known issue with Chromium DevTools. Basically, the HTML and other non-script content is already flushed before DevTools opens and there's no reliable way to get it back. Refreshing the page with DevTools open "corrects" the issue.

Eric
  • 6,965
  • 26
  • 32
31

I had this problem, and have just found that disabling "Enable Javascript Source Maps" from the Inspector settings window (F1) solved it

I recreated my js.map, reenabled the setting and the source was still available.

So I think my problem was that I was serving unminified js (dev settings), but the map (built for prod settings) was still there and out of date.

paul
  • 21,653
  • 1
  • 53
  • 54
18

In my case, I was unable to access the console as it's tab also displayed a blank page. My solution is to use the CTRL+SHIFT+I combination with the blank debugger screen in focus, then type parent.location.reload(true) in the console of the popup debugger.

12

Dev Tools (F12) -> Inspector settings window (F1) -> Restore defaults and reload [button at the bottom] works for me!

Sylwia M
  • 121
  • 1
  • 4
  • This one worked for me, but since I was already in the Chrome v88.x (2021) inspect => source window, I only had to press the F1 key. –  Jan 26 '21 at 15:19
5

In my case there was an extension in chrome causing the debugger to give the blank index page under a "no domain" section of the debugger. After disabling all non-essential extensions in chrome, the debugger showed the correct source again.

Brett Drake
  • 301
  • 3
  • 12
  • 4
    Would have been great if you took a note of extension causing issue. Many extensions might be non-essential for you and essential for me. This makes answer worthless. – Imad Jan 18 '17 at 07:30
  • 5
    I wouldn't agree with "worthless". At least you know to check the plugins. – Brett Drake Jan 18 '17 at 10:44
  • This was my issue - in my case, I had installed UltraSurf Unblock VPN extension. Opening the local debug page in an incognito window brought it up instantly. Bit of a "durrrr" moment I must admit :( haha! – IfElseTryCatch Aug 23 '17 at 07:34
  • Using incognito fixed it for me. – Petah Nov 02 '17 at 05:34
2

I fixed my problem by using a brand new session with command line argument "--user-data-dir", and disabling "Enable Javascript Source Maps". My code shows up fine in Firefox debugger, so looks like caused by a Chrome bug.

Simon
  • 21
  • 1
2

I had the same problem. Even a refresh of the page didn't worked.

Going chrome://help and refreshing the browser + restart worked for me.

You can update Chrome through the menu too:

enter image description here

Charles
  • 11,367
  • 10
  • 77
  • 114
2

I had the same issue where my HTML doc was blank in the Sources tab. I tried a couple of the fixes recommended here, but none of them worked. This suggestion even caused all local scripts to disappear. The only thing that worked for me was, from the inspector window, pressing the F5 key. Credit to this SO answer.

sam hooper
  • 71
  • 4
1

I have noticed that some serious javascript issues cause problems like this. In my case, I was erroneously overwriting my entire document due to a typo.

If you're getting a blank html page in the Chromium WebTools debugger, take a good look at your javascript to make sure it's not doing anything strange.

AWT
  • 3,657
  • 5
  • 32
  • 60
  • 1
    This seems to be what caused the problem for me as well. In my case I had a bad jquery reference. $('inputid') as opposed to $('#inputid'). – Vincent Feb 19 '18 at 18:30
  • This is happening to me [in 2023... 116.0.5845.111] It seems a "bug" that the debugger isnt able to help debug some javascript typos. I have a complex Flask server and after my most recent code update nothing is showing up in the debug window, although the code seems to work. If I run the code to build the template, render but save to file, then load that file in standalone Flask app, then the script is visible (although none of the callback buttons, etc, work). But if I run code to both render and serve template then the debug screen is blank. I'm reduced to lots of "Got here" lines to debug. – Tunneller Aug 27 '23 at 14:44
0

In my case, I was in the Filesystem tab instead of Page tab. From the "Page" tab, select the source code you are working with and do F5 (refresh). It should load the source code for you.

JAY SHIN
  • 9
  • 2
  • CMD-R on Mac worked for me on the Page tab. The (index) code was initially blank but after CMD-R (reload), the source code appeared. Thanks! – joehanna Mar 21 '23 at 03:24
-1

in my case it happend suddenly , after i infected with malware and i reset my browser - deleted cache/appdata.

Solution: remove extension that may affect Js in my case

i removed/disabled the below extension and worked https://chrome.google.com/webstore/detail/quick-javascript-switcher/geddoclleiomckbhadiaipdggiiccfje?hl=en

strange because before i washaving that addon without problem , i think its like CPR to heart . :)

shareef
  • 9,255
  • 13
  • 58
  • 89
-1

In my case, I had gulp with browsersync running for a few days. I bounced gulp and solved my issue.

dman
  • 10,406
  • 18
  • 102
  • 201
-1

I had also this issue when I had a huge java-script file, I had this line

                points.push({
                    location: new google.maps.LatLng(46.5376919, 4.5425704),
                    date : "5/8/2017 5:11:00 PM",
                    free : true
                });

in a for cycle and it was counting 3000 items so the file grow big in the script and the file was blank in chrome sources. (I think I hit some limitation)

After making the file smaller by removing to 100 items it worked just fine.

Dongolo Jeno
  • 414
  • 6
  • 8
-1

To make it easier for others, i am re-posting the high-rated comment from @Vishal (Apr 7, 2016 at 5:37) to Answer from @Eric because i first tried most of the other answers and only after that, i parsed all the comments and found my personal solution (which works only every third try but hey, better than using vscode):

You can get it work by closing the developer tools and again reopening them using the inspect element option.

This worked for me: close dev tools, right click some elment and hit inspect.

Harry
  • 1,233
  • 10
  • 24