title: Webpack babel-loader runtime: Module build failed: TypeError: this.setDynamic is not a function
body: <p>I'm trying to use the <code>babel-loader</code> with the <code>babel-plugin-transform-runtime</code>.</p>
  
  <p>I've followed the instructions at:
  <a href="https://github.com/babel/babel-loader#babel-is-injecting-helpers-into-each-file-and-bloating-my-code" rel="noreferrer">https://github.com/babel/babel-loader#babel-is-injecting-helpers-into-each-file-and-bloating-my-code</a></p>
  
  <p>The relevant code:</p>
  
  <pre><code>rules: [
    // the 'transform-runtime' plugin tells babel to require the runtime
    // instead of inlining it.
    {
      test: /\.js$/,
      exclude: /(node_modules|bower_components)/,
      use: {
        loader: 'babel-loader',
        options: {
          presets: ['@babel/preset-env'],
          plugins: ['@babel/transform-runtime']
        }
      }
    }
  ]
  </code></pre>
  
  <p>And I get the following error on build:</p>
  
  <p><code>Module build failed: Error: Cannot find module '@babel/plugin-transform-runtime'</code></p>
  
  <p>If I'm changing the plugin name to: <code>plugins: ['transform-runtime']</code>, I get the following error:</p>
  
  <p><code>Module build failed: TypeError: this.setDynamic is not a function</code></p>
  
  <p>What is the problem?</p>