11

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.

enter image description here

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.

jozxyqk
  • 16,424
  • 12
  • 91
  • 180
  • 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 Jul 26 '15 at 11:13
  • Does this answer your question? [Chrome developer tools do not show all JavaScript files any more](https://stackoverflow.com/questions/31862344/chrome-developer-tools-do-not-show-all-javascript-files-any-more) – Christian Aug 27 '22 at 22:05

2 Answers2

3

uncheck "disable javascript" and everything works

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.

jozxyqk
  • 16,424
  • 12
  • 91
  • 180
2

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