4

I went through lot of questions and answers about this issue but NONE of the answers are talking about the root cause of the problem and how to solve it permanently.

When, I open the developer tools for any tab in Google Chrome or Edge browsers and check the Sources tab, it is NOT showing the source code (for JavaScript/Script) by default. However, if I refresh the page while Developer Tools is still open, then it starts showing the source code.

I don't know where and how to fix this behavior, earlier this use to work normally when I open Developer Tools, it use to show the source code under Sources tab without refreshing the page.

Some screen-shots to help better understand what I mean:

  1. When I open developer tools, Sources Tab (before refreshing the page). Even when I double click on the File name, it still won't show the source page unless I refresh the whole page. before refreshing the page

  2. Sources tab After refreshing the page after refreshing the page

EDIT: Current settings in the Developer Window just in case that helps in identifying the issue:

enter image description here

SavindraSingh
  • 878
  • 13
  • 39
  • Which version of Edge and Chrome are you using? I click the circle button to refresh the page but don't reproduce what you said. In my situation, some pages in the Sources tab don't show the source code at first and when I click the page again in the Sources tab, it will show the source code. If the source code only shows after refreshing in your situation, I think there might be some issues with your browsers. – Yu Zhou Dec 09 '21 at 09:19
  • I am using Google Chrome Version 96.0.4664.45 (Official Build) (64-bit). And Microsoft Edge Version 95.0.1020.40 (Official build) (64-bit) – SavindraSingh Dec 11 '21 at 02:32
  • I checked with couple of my team members, they are also having same issue. – SavindraSingh Dec 11 '21 at 02:33
  • My Chrome version is 96.0.4664.93 and Edge version is 96.0.1054.53. Could you please update your browsers to the latest version and test again? Besides, you can also refer to [this thread](https://stackoverflow.com/questions/70016096/how-can-i-restore-the-developer-tools-window-to-its-normal-configuration/70016826#70016826) to reset the dev tools to default in Edge and see if it helps. – Yu Zhou Dec 13 '21 at 07:46
  • I tried the solution from the given thread with no luck. Also, regarding the version, when I checked again it is currently at Version 96.0.1054.57 (Official build) (64-bit) and managed by GPO/Organization. – SavindraSingh Jan 04 '22 at 03:27
  • Added the Preferences settings screenshot if that may help – SavindraSingh Jan 04 '22 at 10:07
  • 1
    The Preferences settings look like have no problem. I see that you're debugging a localhost page, does this also happen on any other public pages? If so, I think you might meet with [this issue](https://stackoverflow.com/questions/20196795/chrome-developer-tool-html-script-is-blank-in-source-debugging-tutorial). As this happens with chromium browsers, I suggest that you can open an issue on [this forum](https://bugs.chromium.org/p/chromium/issues/list). – Yu Zhou Jan 05 '22 at 03:10
  • When I open the Source for a public page, (like this one), though it is not showing the source page by default, it still shows the source when I double click on the page file from the left side menu. – SavindraSingh Jan 05 '22 at 11:23
  • Looks like the develop tools work well with other sites. The issue might be in your code. According to the thread I mentioned in my previous comment, the problem can be caused by some serious JavaScript issues. Besides, you can also try disabling "Enable JavaScript source maps" in the Preferences settings and reopen browsers to test. – Yu Zhou Jan 06 '22 at 07:22
  • You are correct this seems to be a known issue as per the forum you have mentioned. Also, tried disabling "Enable JavaScript source maps" in the Preferences settings and it didn't help. – SavindraSingh Jan 11 '22 at 02:21

2 Answers2

0

i've had a similar problem, i systematically deleted parts of my code until it worked and it turns out it was because i was using javascript style comment blocks see here https://stackoverflow.com/a/76834779/7250354

0

Add a console.log in your code, then run the page when your console.log show in the console window then click on that line number on right side, it will forcefully open the source file, it happened with me ;) Happy debugging.