<h1 dir="auto">Bug report</h1>




<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto"><code class="notranslate">webpack-dev-server</code> (via <code class="notranslate">webpack serve</code>) compiles twice on every save in VSCode. This doesn't happen when using an other editor such as Sublime.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">Create a fresh package with <code class="notranslate">webpack</code>, <code class="notranslate">webpack-cli</code> and <code class="notranslate">webpack-dev-server</code> as <code class="notranslate">devDependencies</code>.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// src/index.js

console.log(&quot;Hi&quot;);"><pre class="notranslate"><span class="pl-c">// src/index.js</span>

<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"Hi"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Launch the server:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="webpack serve --mode=production"><pre class="notranslate">webpack serve --mode=production</pre></div>
<p dir="auto">Open the <code class="notranslate">src/index.js</code> file in VSCode. You'll notice in the console's output that every time you press save, the code gets compiled twice. Try with an other editor (such as Sublime) and you'll see that compilation occurs once, as expected.</p>






<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">Compilation should occur only once.</p>


<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  <code class="notranslate">v5.67.0</code><br>
Node.js version: <code class="notranslate">v16.13.0</code><br>
Operating System:  MacOS Monterey<br>
Additional tools: VSCode <code class="notranslate">v1.63.2</code> (with default settings + no extensions)</p>
<h1 dir="auto">Bug report</h1>




<p dir="auto"><strong>What is the current behavior?</strong><br>
Hot module reloading is not working after updating webpack to v5.66.0.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<ul dir="auto">
<li>Clone <a href="https://github.com/saltire/react-node-boilerplate">https://github.com/saltire/react-node-boilerplate</a>.</li>
<li>Run <code class="notranslate">npm i webpack@latest</code> to update to <strong>5.66.0</strong>.</li>
<li>Run <code class="notranslate">npm run watch</code>.</li>
<li>Modify <code class="notranslate">src/App.jsx</code>. The browser console reports <code class="notranslate">bundle rebuilding</code> twice, the request to <code class="notranslate">main.xxxxx.hot-update.json</code> fails with status 404, and the app does not update.</li>
</ul>
<p dir="auto">Notice the issue does not occur if webpack <strong>5.65.0</strong> is installed.</p>






<p dir="auto"><strong>What is the expected behavior?</strong><br>
When making a change to a jsx file, the app should reload automatically.</p>


<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  5.66.0<br>
Node.js version: 16<br>
Operating System: MacOS<br>
Additional tools</p>
<p dir="auto">This repo uses <code class="notranslate">webpack-dev-middleware</code>, <code class="notranslate">webpack-hot-middleware</code>, <code class="notranslate">react-refresh</code>, and <code class="notranslate">@pmmmwh/react-refresh-webpack-plugin</code>, among other packages. The issue may stem from a conflict with one of these, but I don't have enough internal knowledge of webpack or these packages to say which. It could also be a misconfiguration on my part. I'm filing the issue with <code class="notranslate">webpack</code> because I was able to isolate the problem to an update of this package.</p>
<p dir="auto">Let me know if you need any more info!</p>