I blame Firefox and other web browsers which deny loading JS files if your page was loaded from file://. If you could simply run an HTML file from your hard drive and have a fully functional web application, you wouldn't need Electron.
~/scratch/wrong$ cat ./index.html
<!doctype html>
<html>
<head>
<script src="otherfile.js"></script>
</head>
<body>
<p>otherfile.js did not run</p>
</body>
</html>
~/scratch/wrong$ cat ./otherfile.js
window.onload = (() => {
document.querySelector("p").textContent = "wrong. (otherfile.js ran)";
});