127

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.

7
  • 8
    location.reload(true) worked for me. Commented Jan 17, 2017 at 18:09
  • 1
    Yeah, but that reloads the page, and loses any interaction you might have had on the page before opening the debugger. Commented Dec 13, 2017 at 13:41
  • where should i write "location.reload(true)" Commented Dec 21, 2018 at 9:47
  • 3
    Still facing the issue in 2019! Commented Mar 10, 2019 at 6:34
  • 2
    This is happen in the latest version of Chrome, Oct 2019, but the location.reload(true) trick didn't load anything. Incidentally, the source window only shows the line number 1, but nothing else. Commented Oct 1, 2019 at 15:33

15 Answers 15

90

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
Sign up to request clarification or add additional context in comments.

1 Comment

this worked for me, location.reload(true) didn't work using chrome 98.0.4758.102
67

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.

20 Comments

Agreed - I have the issue and this fix is either out of date (for a previous identical issue), or does not work.
i am also having the same issue. Refreshing the page does not get around the issue.
you can get it work by closing the developer tools and again reopening them using the inspect element option. It works for me.
Still going in December 2017!
Bug is still present - May 2019
|
32

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.

1 Comment

close chrome and reopen after changing the setting too!
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.

4 Comments

As in WillB's comment above, that reloads the page, and loses any interaction you might have had on the page before opening the debugger.
Awesome! This worked for me after 2 hours of struggle.
I don't know what the parent.location.reload implies but it solved my problem after several chrome restart / hard refresh / emptying chrome cache data! thanks!
Glad I could help. It reloads the parent window (the blank window where you typed CTRL+SHIFT+I) from the child window.
13

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

1 Comment

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.
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.

4 Comments

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.
I wouldn't agree with "worthless". At least you know to check the plugins.
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!
Using incognito fixed it for me.
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.

Comments

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

Comments

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.

Comments

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.

2 Comments

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').
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.
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.

1 Comment

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!
-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 . :)

Comments

-1

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

Comments

-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.

Comments

-1

I also had this issue when I had a huge data inserted into an array, the problem was because of this:

                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 and because of this, the file was blank in chrome sources. (I think I hit some limitations)

After making the array smaller around 100 items it worked just fine.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.