<h1 dir="auto">Bug report</h1>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">When I upgrade Webpack from 4.29.2 to 4.29.3, import() breaks.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">Using a relatively straightforward, up-to-date package.json, code that formerly worked using import() stops building after upgrading from 4.29.2 to 4.29.3. The error message is, e.g:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR in ./js/registry.js 22:44
Module parse failed: Unexpected token (22:44)
You may need an appropriate loader to handle this file type."><pre class="notranslate"><code class="notranslate">ERROR in ./js/registry.js 22:44
Module parse failed: Unexpected token (22:44)
You may need an appropriate loader to handle this file type.
</code></pre></div>
<p dir="auto">Downgrading to the previous version eliminates this error.</p>
<p dir="auto">In other words, the bug has been easy for me to reproduce/ toggle on/off since I isolated the package version bump which introduced it. (I can induce the bug by <code class="notranslate">rm -rf node_modules/*; npm install</code> after upgrading my <code class="notranslate">package.json</code> and just as easily quell it again by the same operation after downgrading the webpack requirement in <code class="notranslate">package.json</code> back down to 4.29.2.)</p>
<p dir="auto">Apologies, I have not yet had time to come up with a minimal example, but here are my config files.</p>
<p dir="auto">package.json: <a href="https://gist.github.com/1attice/dde6cd694fcb5202ebb78497772417b5">https://gist.github.com/1attice/dde6cd694fcb5202ebb78497772417b5</a><br>
webpack.config.js: <a href="https://gist.github.com/1attice/1eef81fbd36ab67b9bd26600bf320e5b">https://gist.github.com/1attice/1eef81fbd36ab67b9bd26600bf320e5b</a><br>
.babelrc: <a href="https://gist.github.com/1attice/906515f7386b5c36d03dcb420872cb04">https://gist.github.com/1attice/906515f7386b5c36d03dcb420872cb04</a></p>
<p dir="auto">And here is the code that occasions the error:<br>
registry.js: <a href="https://gist.github.com/1attice/bb922e8e3d155db53ad1942de7ccd31c">https://gist.github.com/1attice/bb922e8e3d155db53ad1942de7ccd31c</a></p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">Compilation should proceed normally, as under 4.29.2.</p>
<p dir="auto">webpack version: 4.29.3<br>
Node.js version: 10.14.1<br>
Operating System: MacOS 10.14.2<br>
Additional tools: see package.json</p>
<h1 dir="auto">Bug report</h1>
<p dir="auto">Type definition error for OutputFileSystem when assigning to memory volume.</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error TS2322: Type 'MemoryFileSystem' is not assignable to type 'OutputFileSystem'.
  Types of property 'mkdir' are incompatible.
    Type '{ (path: string, callback: (err: Error | null) =&gt; void): void; (path: string, optArg: {}, callback: (err: Error | null, result?: any) =&gt; void): void; }' is not assignable to type '(arg0: string, arg1: (arg0?: ErrnoException | undefined) =&gt; void) =&gt; void'.
      Types of parameters 'callback' and 'arg1' are incompatible.
        Types of parameters 'arg0' and 'err' are incompatible.
          Type 'Error | null' is not assignable to type 'ErrnoException | undefined'.
            Type 'null' is not assignable to type 'ErrnoException | undefined'.
"><pre class="notranslate"><code class="notranslate">error TS2322: Type 'MemoryFileSystem' is not assignable to type 'OutputFileSystem'.
  Types of property 'mkdir' are incompatible.
    Type '{ (path: string, callback: (err: Error | null) =&gt; void): void; (path: string, optArg: {}, callback: (err: Error | null, result?: any) =&gt; void): void; }' is not assignable to type '(arg0: string, arg1: (arg0?: ErrnoException | undefined) =&gt; void) =&gt; void'.
      Types of parameters 'callback' and 'arg1' are incompatible.
        Types of parameters 'arg0' and 'err' are incompatible.
          Type 'Error | null' is not assignable to type 'ErrnoException | undefined'.
            Type 'null' is not assignable to type 'ErrnoException | undefined'.

</code></pre></div>
<p dir="auto">Reproduce:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import MemoryFs from 'memory-fs';
compiler.outputFileSystem = new MemoryFs(); "><pre class="notranslate"><code class="notranslate">import MemoryFs from 'memory-fs';
compiler.outputFileSystem = new MemoryFs(); 
</code></pre></div>
<p dir="auto">or</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { Volume } from 'memfs';
compiler.outputFileSystem = createFsFromVolume(new Volume());"><pre class="notranslate"><code class="notranslate">import { Volume } from 'memfs';
compiler.outputFileSystem = createFsFromVolume(new Volume());
</code></pre></div>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">Previously, with webpack v4 it was working when using the DefinitelyTyped webpack definitions.</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version: 5.11.1<br>
Node.js version: 14.15.4</p>