Javascript files not appearing in chrome developer tools - Stack Overflow

This happens periodically and has been for weeks. Most of the time everything's fine, but occasion

This happens periodically and has been for weeks. Most of the time everything's fine, but occasionally chrome simply doesn't show JS files. Visiting the same site via another URL or viewing in incognito can fix it. Restarting the server doesn't help. I'm pretty sure it's a problem with chrome (v43.0.2357.134 v44.0.2403.107, still happens). I'm using django's runserver, though not sure it's relevant since the html is fine, validates at w3c and I can go to the js URL and load it.

I'm not even sure how to start debugging something like this. Is it a known bug with chrome? Perhaps some flag/setting that's wrong?


UPDATE:

If I have the debugger open when I refresh I get no js. otherwise it's fine.

ANOTHER UPDATE:

Here's my file structure:

<!DOCTYPE html>
<html>
    <head>
        <script type="text/javascript" src="test.js" ></script>
    </head>
    <body>
    </body>
</html>

Here's the javascript in test.js.

alert("hi");

When I refresh this page (opened by double clicking the file) with the debugger open, alert doesn't run and the js file doesn't appear in the "Sources" tab. The same behaviour when inlining the js.

This happens periodically and has been for weeks. Most of the time everything's fine, but occasionally chrome simply doesn't show JS files. Visiting the same site via another URL or viewing in incognito can fix it. Restarting the server doesn't help. I'm pretty sure it's a problem with chrome (v43.0.2357.134 v44.0.2403.107, still happens). I'm using django's runserver, though not sure it's relevant since the html is fine, validates at w3c and I can go to the js URL and load it.

I'm not even sure how to start debugging something like this. Is it a known bug with chrome? Perhaps some flag/setting that's wrong?


UPDATE:

If I have the debugger open when I refresh I get no js. otherwise it's fine.

ANOTHER UPDATE:

Here's my file structure:

<!DOCTYPE html>
<html>
    <head>
        <script type="text/javascript" src="test.js" ></script>
    </head>
    <body>
    </body>
</html>

Here's the javascript in test.js.

alert("hi");

When I refresh this page (opened by double clicking the file) with the debugger open, alert doesn't run and the js file doesn't appear in the "Sources" tab. The same behaviour when inlining the js.

Share Improve this question edited Jul 27, 2015 at 12:12 jozxyqk asked Jul 26, 2015 at 11:07 jozxyqkjozxyqk 17.4k15 gold badges98 silver badges197 bronze badges 2
  • As long as it stays "occasional", it'll be very hard to track down - it's probably deterministic, we just don't know the exact circumstances yet. Give us more details, what's your build process like, what is included in index.html and by what mechanism, what does the file structure look like normally and in the occasional off case? etc – doldt Commented Jul 26, 2015 at 11:13
  • Does this answer your question? Chrome developer tools do not show all JavaScript files any more – Christian Commented Aug 27, 2022 at 22:05
Add a ment  | 

2 Answers 2

Reset to default 3

Think this pretty much sums it up.

The Disable JavaScript option does not disable JS globally, but only when the dev tools are open on page load. Most of the time I was only bringing up the dev tools to check on a errors and inspect the page after it had loaded.

If it ever worked then, go to F1 (i.e) setting of the developer tool. then select (restore detauls and reload.) All should be fine

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743731109a4497449.html

相关推荐

  • Javascript files not appearing in chrome developer tools - Stack Overflow

    This happens periodically and has been for weeks. Most of the time everything's fine, but occasion

    6天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信