<h1 dir="auto">Bug report</h1>
<p dir="auto">I want to replace all the module name like <code class="notranslate">node:fs</code> to <code class="notranslate">fs</code>, so I set resolve.alias:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="resolve: {
        alias: {
            'node:': ''
        },
    },"><pre class="notranslate"><span class="pl-s1">resolve</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">alias</span>: <span class="pl-kos">{</span>
            <span class="pl-s">'node:'</span>: <span class="pl-s">''</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span></pre></div>




<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">error message:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="configuration.resolve.alias['node:'] should be a non-empty string"><pre class="notranslate"><code class="notranslate">configuration.resolve.alias['node:'] should be a non-empty string
</code></pre></div>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">No validate configuration failed error.</p>


<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  5.65.0<br>
Node.js version: 16.13.1<br>
Operating System: MacOS 12.1</p>
<p dir="auto">Hey there! I have a question.</p>
<p dir="auto">I have two npm-packages: <code class="notranslate">sub</code> and <code class="notranslate">common</code>. I'm writing my app using this packages.</p>
<p dir="auto"><strong><code class="notranslate">sub</code></strong> includes <code class="notranslate">common</code> as dependency.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import common from 'common';

// some code here"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">common</span> <span class="pl-k">from</span> <span class="pl-s">'common'</span><span class="pl-kos">;</span>

<span class="pl-c">// some code here</span></pre></div>
<p dir="auto"><strong>my app</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import sub from 'sub';
import common from 'common';

// some code here"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">sub</span> <span class="pl-k">from</span> <span class="pl-s">'sub'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s1">common</span> <span class="pl-k">from</span> <span class="pl-s">'common'</span><span class="pl-kos">;</span>

<span class="pl-c">// some code here</span></pre></div>
<p dir="auto">The final bundle contains two copies of <code class="notranslate">common</code> package. The first copy is for my app, and the second one - for package <code class="notranslate">sub</code>.<br>
<strong>final bundle</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="...
// my app
({ /* some deps */ }) =&gt; {
    var sub = __webpack_require__(1);
    var common = __webpack_require__(2);
}
// end of my app

...
// sub
({ /* some deps */ }) =&gt; {
    var common = __webpack_require__(3);
    //                               ^ not the same line in app (in app uses 2)
}
// end of sub
...

// module 2
({ /* some deps */ }) =&gt; {
    // code of common 
}
// end module 2
...

// module 3
({ /* some deps */ }) =&gt; {
    // code of common
}
// end module 3"><pre class="notranslate">...
<span class="pl-c">// my app</span>
<span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c">/* some deps */</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">var</span> <span class="pl-s1">sub</span> <span class="pl-c1">=</span> <span class="pl-en">__webpack_require__</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">var</span> <span class="pl-s1">common</span> <span class="pl-c1">=</span> <span class="pl-en">__webpack_require__</span><span class="pl-kos">(</span><span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c">// end of my app</span>

<span class="pl-kos">.</span><span class="pl-kos">.</span><span class="pl-kos">.</span>
<span class="pl-c">// sub</span>
<span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c">/* some deps */</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-s1">var</span> common <span class="pl-c1">=</span> <span class="pl-en">__webpack_require__</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-c">//                               ^ not the same line in app (in app uses 2)</span>
<span class="pl-kos">}</span>
<span class="pl-c">// end of sub</span>
...

<span class="pl-c">// module 2</span>
<span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c">/* some deps */</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-c">// code of common </span>
<span class="pl-kos">}</span>
<span class="pl-c">// end module 2</span>
<span class="pl-kos">.</span><span class="pl-kos">.</span><span class="pl-kos">.</span>

<span class="pl-c">// module 3</span>
<span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c">/* some deps */</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-c">// code of common</span>
<span class="pl-kos">}</span>
<span class="pl-c">// end module 3</span></pre></div>
<p dir="auto">Could I combine <code class="notranslate">common</code> in one module to avoid duplication? Thanks!</p>