title: How to fix: "Failed to load module script ..." Angular 8, Electron 5
body: <p>I am trying to make an Electron 5 app using Angular 8. I've followed several tutorials online and I'm still getting the same error.</p>
  
  <p>I already created a new project, ran <code>ng serve --open</code> and it worked fine, I got the default angular home page.</p>
  
  <p>I then installed electron with <code>npm install --save-dev electron</code>. I created my <code>main.js</code> file in the root directory of the project and put:</p>
  
  <pre><code>const { app, BrowserWindow } = require('electron')
  
  let win;
  
  function createWindow() {
      // Create the browser window.
      win = new BrowserWindow({
          width: 800,
          height: 600,
          webPreferences: {
              nodeIntegration: true
          }
      })
  
      win.loadFile('dist/myproject/index.html')
      // Open the DevTools.
      win.webContents.openDevTools()
      win.on('closed', () =&gt; {
          win = null
      })
  }
  app.on('ready', createWindow)
  app.on('window-all-closed', () =&gt; {
      if (process.platform !== 'darwin') {
          app.quit()
      }
  })
  app.on('activate', () =&gt; {
      if (win === null) {
          createWindow()
      }
  })
  </code></pre>
  
  <p>I also changed the <code>&lt;base href="/"&gt;</code> to <code>&lt;base href="./"&gt;</code> in <code>index.html</code>.
  I modified the <code>package.json</code> file accordingly as well:</p>
  
  <pre><code>  "main": "main.js",
    "scripts": {
      "ng": "ng",
      "start": "ng serve",
      "build": "ng build",
      "test": "ng test",
      "lint": "ng lint",
      "e2e": "ng e2e",
      "electron": "ng build &amp;&amp; electron ."
    },
  </code></pre>
  
  <p>The issue I'm getting when running <code>npm run electron</code> is a white screen with these errors:</p>
  
  <pre><code>runtime-es2015.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
  styles-es2015.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
  main-es2015.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
  polyfills-es2015.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
  vendor-es2015.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
  </code></pre>