title: electron & react: No resource with given URL found, DevTools failed to load SourceMap
body: <p>For production (mac dmg) builds of my electron app, I am unable to trigger <code>location.reload()</code>, connect to <code>redux-dev-tools</code>, and the sourcemap fails to load.</p>
  <p>When the app is loaded, the console warns that it cannot load the sourcemap:
  <img src="https://user-images.githubusercontent.com/9858612/117014604-40408c80-acf1-11eb-8c94-965e39b1d0d1.png" alt="Screen Shot 2021-05-04 at 3 56 09 PM" /></p>
  <p>The <code>index.html</code> in the sources says the resource cannot be loaded:
  <img src="https://user-images.githubusercontent.com/9858612/117014725-5bab9780-acf1-11eb-957e-9a800cac51fd.png" alt="Screen Shot 2021-05-04 at 3 56 57 PM" /></p>
  <p>Executing <code>location.reload()</code> causes the app to crash with a white screen and no console logs (this command works in electron dev builds).</p>
  <p>My electron code is contained in <code>electron/index.electron.js</code> and the relevant snippets are:</p>
  <pre class="lang-js prettyprint-override"><code>const options = {
      icon: join(__dirname, '../src/common/assets/app-icons/png/256x256.png'),
      webPreferences: {
          nodeIntegration: false,
          preload: join(__dirname, &quot;preload.js&quot;)
      }
  };
  // ...
  mainWindow = new BrowserWindow({
    ...options,
    ...windowOptions
  });
  // ...    
  const startUrl = process.env.ELECTRON_START_URL || url.format({
      pathname: &quot;file://../build/index.html&quot;
  });
  // ...
  mainWindow.loadURL(startUrl);
  </code></pre>
  <p>The relevant <code>package.json</code> snippets:</p>
  <pre class="lang-json prettyprint-override"><code>&quot;homepage&quot;: &quot;./&quot;,
  &quot;scripts&quot;: {
    &quot;electron-build:mac&quot;: &quot;rm -rf dist/ &amp;&amp; yarn build &amp;&amp; electron-builder -m&quot;,
  },
  &quot;build&quot;: {
      &quot;appId&quot;: &quot;appId&quot;,
      &quot;extends&quot;: null,
      &quot;files&quot;: [
        &quot;dist/**/*&quot;,
        &quot;build/**/*&quot;,
        &quot;node_modules/**/*&quot;,
        &quot;src/common/assets/**/*&quot;,
        &quot;public/*&quot;,
        &quot;electron/**/*&quot;
      ],
      &quot;directories&quot;: {
        &quot;buildResources&quot;: &quot;./src/common/assets&quot;
      }
    },
  &quot;devDependencies&quot;: {
    &quot;electron&quot;: &quot;^11.3.0&quot;,
    &quot;electron-builder&quot;: &quot;^22.9.1&quot;
  </code></pre>
  <p>The only thing I can confirm in dev is that running <code>location.reload()</code> successfully reloads the app.</p>
  <p>Thanks :)</p>