<p dir="auto"><strong>report a <em>bug</em></strong><br>
I think it's a bug.</p>


<p dir="auto"><strong>current behavior &amp; the steps to reproduce</strong><br>
I add the plugin:<br>
<code class="notranslate">plugins: [ /**/ new webpack.optimize.MinChunkSizePlugin({ minChunkSize: 10000 }), /**/ ]</code><br>
in webpack.config.js.<br>
When I bundle my application, I got:</p>
<blockquote>
<p dir="auto">/**/*/node_modules/webpack/lib/optimize/MinChunkSizePlugin.js:59<br>
pair[2].integrate(pair[3], "min-size");<br>
^</p>
</blockquote>
<blockquote>
<p dir="auto">TypeError: pair[2].integrate is not a function<br>
at Compilation.compilation.plugin (/<strong>/*/node_modules/webpack/lib/optimize/MinChunkSizePlugin.js:59:13)<br>
at Compilation.applyPluginsBailResult1 (/</strong>/<em>/node_modules/tapable/lib/Tapable.js:120:27)<br>
at Compilation.seal (/**/</em>/node_modules/webpack/lib/Compilation.js:572:9)<br>
at /<strong>/*/node_modules/webpack/lib/Compiler.js:488:16<br>
at /</strong>/<em>/node_modules/tapable/lib/Tapable.js:225:11<br>
at _addModuleChain (/**/</em>/node_modules/webpack/lib/Compilation.js:477:11)<br>
at processModuleDependencies.err (/**/*/node_modules/webpack/lib/Compilation.js:448:13)<br>
at _combinedTickCallback (internal/process/next_tick.js:67:7)<br>
at process._tickCallback (internal/process/next_tick.js:98:9)</p>
</blockquote>
<p dir="auto">But if I remove the MinChunkSizePlugin, the bundle will be succeeded.</p>
<p dir="auto"><strong>other relevant information</strong></p>
<ol dir="auto">
<li>"webpack": "^2.3.0"</li>
<li>bundle cli: cross-env NODE_ENV=production webpack --display-modules --sort-modules-by size</li>
</ol>
<h1 dir="auto">Bug report</h1>




<p dir="auto">I have the following config (optimization part):</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" optimization: {
    runtimeChunk: {
      name: 'runtime',
    },

    splitChunks: {
      minChunks: 2,
      minSize: 30000,

      cacheGroups: {
        clientApplication: {
          name: 'clientApplication',
          test: /applications\/client/,
          chunks: 'all',
          enforce: true,
        },
      },
    },"><pre class="notranslate"> <span class="pl-s1">optimization</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">runtimeChunk</span>: <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'runtime'</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>

    <span class="pl-c1">splitChunks</span>: <span class="pl-kos">{</span>
      <span class="pl-c1">minChunks</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span>
      <span class="pl-c1">minSize</span>: <span class="pl-c1">30000</span><span class="pl-kos">,</span>

      <span class="pl-c1">cacheGroups</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">clientApplication</span>: <span class="pl-kos">{</span>
          <span class="pl-c1">name</span>: <span class="pl-s">'clientApplication'</span><span class="pl-kos">,</span>
          <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span>applications<span class="pl-cce">\/</span>client<span class="pl-c1">/</span></span><span class="pl-kos">,</span>
          <span class="pl-c1">chunks</span>: <span class="pl-s">'all'</span><span class="pl-kos">,</span>
          <span class="pl-c1">enforce</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</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 in logs while production build:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/Users/a.malko/Work/frontend/node_modules/schema-utils/dist/validate.js:96
    throw new _ValidationError.default(errors, schema, configuration);
          ^
ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration.optimization.splitChunks should be one of these:
   false | object { automaticNameDelimiter?, cacheGroups?, chunks?, enforceSizeThreshold?, fallbackCacheGroup?, filename?, hidePathInfo?, maxAsyncRequests?, maxAsyncSize?, maxInitialRequests?, maxInitialSize?, maxSize?, minChunks?, minRemainingSize?, minSize?, name?, usedExports? }
   -&gt; Optimize duplication and caching by splitting chunks by shared modules and cache group.
   Details:
    * configuration.optimization.splitChunks.cacheGroups['clientApplication'].test should be one of these:
      RegExp | string | function
      -&gt; Assign modules to a cache group by module name.
      Details:
       * configuration.optimization.splitChunks.cacheGroups['clientApplication'].test should be an instance of RegExp.
       * configuration.optimization.splitChunks.cacheGroups['clientApplication'].test should be a string.
       * configuration.optimization.splitChunks.cacheGroups['clientApplication'].test should be an instance of function.
    at validate (/Users/a.malko/Work/frontend/node_modules/schema-utils/dist/validate.js:96:11)
    at validateSchema (/Users/a.malko/Work/frontend/node_modules/webpack/lib/validateSchema.js:45:2)
    at webpack (/Users/a.malko/Work/frontend/node_modules/webpack/lib/webpack.js:100:2)
    at f (/Users/a.malko/Work/frontend/node_modules/webpack/lib/index.js:31:15)
    at processOptions (/Users/a.malko/Work/frontend/node_modules/webpack-cli/bin/cli.js:272:16)
    at /Users/a.malko/Work/frontend/node_modules/webpack-cli/bin/cli.js:364:3
    at Object.parse (/Users/a.malko/Work/frontend/node_modules/yargs/yargs.js:576:18)
    at /Users/a.malko/Work/frontend/node_modules/webpack-cli/bin/cli.js:49:8
    at Object.&lt;anonymous&gt; (/Users/a.malko/Work/frontend/node_modules/webpack-cli/bin/cli.js:366:3)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47"><pre class="notranslate">/Users/a.malko/Work/frontend/node_modules/schema-utils/dist/validate.js:96
    throw new _ValidationError.default(errors, schema, configuration)<span class="pl-k">;</span>
          ^
ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration.optimization.splitChunks should be one of these:
   <span class="pl-c1">false</span> <span class="pl-k">|</span> object { automaticNameDelimiter<span class="pl-k">?</span>, cacheGroups<span class="pl-k">?</span>, chunks<span class="pl-k">?</span>, enforceSizeThreshold<span class="pl-k">?</span>, fallbackCacheGroup<span class="pl-k">?</span>, filename<span class="pl-k">?</span>, hidePathInfo<span class="pl-k">?</span>, maxAsyncRequests<span class="pl-k">?</span>, maxAsyncSize<span class="pl-k">?</span>, maxInitialRequests<span class="pl-k">?</span>, maxInitialSize<span class="pl-k">?</span>, maxSize<span class="pl-k">?</span>, minChunks<span class="pl-k">?</span>, minRemainingSize<span class="pl-k">?</span>, minSize<span class="pl-k">?</span>, name<span class="pl-k">?</span>, usedExports<span class="pl-k">?</span> }
   -<span class="pl-k">&gt;</span> Optimize duplication and caching by splitting chunks by shared modules and cache group.
   Details:
    <span class="pl-k">*</span> configuration.optimization.splitChunks.cacheGroups[<span class="pl-s"><span class="pl-pds">'</span>clientApplication<span class="pl-pds">'</span></span>].test should be one of these:
      RegExp <span class="pl-k">|</span> string <span class="pl-k">|</span> function
      -<span class="pl-k">&gt;</span> Assign modules to a cache group by module name.
      Details:
       <span class="pl-k">*</span> configuration.optimization.splitChunks.cacheGroups[<span class="pl-s"><span class="pl-pds">'</span>clientApplication<span class="pl-pds">'</span></span>].test should be an instance of RegExp.
       <span class="pl-k">*</span> configuration.optimization.splitChunks.cacheGroups[<span class="pl-s"><span class="pl-pds">'</span>clientApplication<span class="pl-pds">'</span></span>].test should be a string.
       <span class="pl-k">*</span> configuration.optimization.splitChunks.cacheGroups[<span class="pl-s"><span class="pl-pds">'</span>clientApplication<span class="pl-pds">'</span></span>].test should be an instance of function.
    at validate (/Users/a.malko/Work/frontend/node_modules/schema-utils/dist/validate.js:96:11)
    at validateSchema (/Users/a.malko/Work/frontend/node_modules/webpack/lib/validateSchema.js:45:2)
    at webpack (/Users/a.malko/Work/frontend/node_modules/webpack/lib/webpack.js:100:2)
    at f (/Users/a.malko/Work/frontend/node_modules/webpack/lib/index.js:31:15)
    at processOptions (/Users/a.malko/Work/frontend/node_modules/webpack-cli/bin/cli.js:272:16)
    at /Users/a.malko/Work/frontend/node_modules/webpack-cli/bin/cli.js:364:3
    at Object.parse (/Users/a.malko/Work/frontend/node_modules/yargs/yargs.js:576:18)
    at /Users/a.malko/Work/frontend/node_modules/webpack-cli/bin/cli.js:49:8
    at Object.<span class="pl-k">&lt;</span>anonymous<span class="pl-k">&gt;</span> (/Users/a.malko/Work/frontend/node_modules/webpack-cli/bin/cli.js:366:3)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47</pre></div>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">You can clone this repo <a href="https://github.com/artem-malko/webpack-5-beta-config-bug">https://github.com/artem-malko/webpack-5-beta-config-bug</a> and try it by yourself.</p>






<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">No errors)</p>


<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  v5.0.0-beta.26-v5.0.0-beta.29<br>
Node.js version: v14.1.0<br>
Operating System: macOS Catalina<br>
Additional tools:</p>