<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/main/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Electron Version</h3>
<p dir="auto">15.0.0</p>
<h3 dir="auto">What operating system are you using?</h3>
<p dir="auto">Windows</p>
<h3 dir="auto">Operating System Version</h3>
<p dir="auto">Windows 10 Professional</p>
<h3 dir="auto">What arch are you using?</h3>
<p dir="auto">x64</p>
<h3 dir="auto">Last Known Working Electron version</h3>
<p dir="auto">Not tested other electron vesions</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">I am expecting to not see warnings</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">I see these warnings:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/preload.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/renderer.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/rx-ipc.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/Rx.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/Subject.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/Observable.js.map: Unexpected end of JSON input"><pre class="notranslate"><code class="notranslate">DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/preload.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/renderer.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/rx-ipc.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/Rx.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/Subject.js.map: Unexpected end of JSON input
DevTools failed to load source map: Could not parse content for file:///C:/work/MyProject/repo/dist/frontend/Observable.js.map: Unexpected end of JSON input
</code></pre></div>
<h3 dir="auto">Testcase Gist URL</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">Hi,</p>
<p dir="auto">in few words:</p>
<ol dir="auto">
<li>Under Linux (Debian Bookworm) works, under Windows, I have the warnings</li>
<li>I am using Parcel v2 to create the bundle</li>
<li>The issue seems quite clear: somehow under Windows it pretends to have the paths inside the "frontend" folder. Instead the files are inside the "backend" sister-folder, or inside the "node_modules/" folders. I have no idea of why this happens only under Windows... maybe some platform dependent code of electron</li>
<li>I have seen the related issues (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="595735926" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/22996" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/22996/hovercard" href="https://github.com/electron/electron/issues/22996">#22996</a> seems the more relevant, but maybe also <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="875497709" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/28993" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/28993/hovercard" href="https://github.com/electron/electron/issues/28993">#28993</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="676035447" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/24916" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/24916/hovercard" href="https://github.com/electron/electron/issues/24916">#24916</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="656546770" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/24537" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/24537/hovercard" href="https://github.com/electron/electron/issues/24537">#24537</a>), but I have open this one since it is similar, but not equal, and they are referring to much older versions of electron</li>
</ol>
<p dir="auto">Regards.</p>
<h3 dir="auto">Preflight Checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://www.github.com/electron/electron/issues">issue tracker</a> for a feature request that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Electron Version</h3>
<p dir="auto">^11.3.0</p>
<h3 dir="auto">What operating system are you using?</h3>
<p dir="auto">macOS</p>
<h3 dir="auto">Operating System Version</h3>
<p dir="auto">macOS Big Sur 11.2.3</p>
<h3 dir="auto">What arch are you using?</h3>
<p dir="auto">x64</p>
<h3 dir="auto">Last Known Working Electron version</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Expected Behavior</h3>
<ul dir="auto">
<li>location.reload() or electron reload shortcut to work in prod</li>
<li>sourcemap to load in prod</li>
</ul>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">For production (mac dmg) builds of my electron app, I am unable to trigger <code class="notranslate">location.reload()</code>, connect to <code class="notranslate">redux-dev-tools</code>, and the sourcemap fails to load.</p>
<p dir="auto">When the app is loaded, the console warns that it cannot load the sourcemap:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/9858612/117014604-40408c80-acf1-11eb-8c94-965e39b1d0d1.png"><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" style="max-width: 100%;"></a></p>
<p dir="auto">The <code class="notranslate">index.html</code> in the sources says the resource cannot be loaded:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/9858612/117014725-5bab9780-acf1-11eb-957e-9a800cac51fd.png"><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" style="max-width: 100%;"></a></p>
<p dir="auto">Executing <code class="notranslate">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 dir="auto">My electron code is contained in <code class="notranslate">electron/index.electron.js</code> and the relevant snippets are:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="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);"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">options</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
    <span class="pl-c1">icon</span>: <span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'../src/common/assets/app-icons/png/256x256.png'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
    <span class="pl-c1">webPreferences</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">nodeIntegration</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
        <span class="pl-c1">preload</span>: <span class="pl-en">join</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">"preload.js"</span><span class="pl-kos">)</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-c">// ...</span>
<span class="pl-s1">mainWindow</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">BrowserWindow</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  ...<span class="pl-s1">options</span><span class="pl-kos">,</span>
  ...<span class="pl-s1">windowOptions</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// ...    </span>
<span class="pl-k">const</span> <span class="pl-s1">startUrl</span> <span class="pl-c1">=</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">ELECTRON_START_URL</span> <span class="pl-c1">||</span> <span class="pl-s1">url</span><span class="pl-kos">.</span><span class="pl-en">format</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">pathname</span>: <span class="pl-s">"file://../build/index.html"</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// ...</span>
<span class="pl-s1">mainWindow</span><span class="pl-kos">.</span><span class="pl-en">loadURL</span><span class="pl-kos">(</span><span class="pl-s1">startUrl</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">The relevant <code class="notranslate">package.json</code> snippets:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&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;"><pre class="notranslate"><span class="pl-ent">"homepage"</span>: <span class="pl-s"><span class="pl-pds">"</span>./<span class="pl-pds">"</span></span>,
<span class="pl-ent">"scripts"</span>: {
  <span class="pl-ent">"electron-build:mac"</span>: <span class="pl-s"><span class="pl-pds">"</span>rm -rf dist/ &amp;&amp; yarn build &amp;&amp; electron-builder -m<span class="pl-pds">"</span></span>,
},
<span class="pl-ent">"build"</span>: {
    <span class="pl-ent">"appId"</span>: <span class="pl-s"><span class="pl-pds">"</span>appId<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"extends"</span>: <span class="pl-c1">null</span>,
    <span class="pl-ent">"files"</span>: [
      <span class="pl-s"><span class="pl-pds">"</span>dist/**/*<span class="pl-pds">"</span></span>,
      <span class="pl-s"><span class="pl-pds">"</span>build/**/*<span class="pl-pds">"</span></span>,
      <span class="pl-s"><span class="pl-pds">"</span>node_modules/**/*<span class="pl-pds">"</span></span>,
      <span class="pl-s"><span class="pl-pds">"</span>src/common/assets/**/*<span class="pl-pds">"</span></span>,
      <span class="pl-s"><span class="pl-pds">"</span>public/*<span class="pl-pds">"</span></span>,
      <span class="pl-s"><span class="pl-pds">"</span>electron/**/*<span class="pl-pds">"</span></span>
    ],
    <span class="pl-ent">"directories"</span>: {
      <span class="pl-ent">"buildResources"</span>: <span class="pl-s"><span class="pl-pds">"</span>./src/common/assets<span class="pl-pds">"</span></span>
    }
  },
<span class="pl-ent">"devDependencies"</span>: {
  <span class="pl-ent">"electron"</span>: <span class="pl-s"><span class="pl-pds">"</span>^11.3.0<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"electron-builder"</span>: <span class="pl-s"><span class="pl-pds">"</span>^22.9.1<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">The only thing I can confirm in dev is that running <code class="notranslate">location.reload()</code> successfully reloads the app.</p>
<p dir="auto">Thanks :)</p>
<h3 dir="auto">Testcase Gist URL</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional Information</h3>
<p dir="auto">The same problems exist for linux and windows builds</p>