<h2 dir="auto">Bug Report</h2>
<p dir="auto">We've been working fine on 7.12.17, but tried updating to 7.13.5 - no breaking changes are mentioned and this is the only change we did. It errors out, complaining about regeneratorRuntime is not defined.</p>
<p dir="auto">We are using <code class="notranslate">"browserslist": "last 2 Chrome versions"</code> in package.json, with this babelrc:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;presets&quot;: [
    &quot;@babel/preset-env&quot;,
    &quot;@babel/preset-typescript&quot;,
    &quot;@babel/preset-react&quot;
  ],
  &quot;plugins&quot;: [
    &quot;@babel/plugin-proposal-class-properties&quot;,
    &quot;@babel/plugin-proposal-optional-chaining&quot;
  ]
}"><pre class="notranslate"><code class="notranslate">{
  "presets": [
    "@babel/preset-env",
    "@babel/preset-typescript",
    "@babel/preset-react"
  ],
  "plugins": [
    "@babel/plugin-proposal-class-properties",
    "@babel/plugin-proposal-optional-chaining"
  ]
}
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong></p>
<p dir="auto">Previous with 7.12.7, no issues seen.</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">7.13.5 should continue to work</p>
<p dir="auto"><strong>Environment</strong></p>
<p dir="auto">(Before - Working):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" System:
    OS: macOS 11.2.1
  Binaries:
    Node: 15.2.1 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/Cellar/node/15.2.1/bin/yarn
    npm: 6.14.8 - /usr/local/bin/npm
  npmPackages:
    @babel/plugin-proposal-class-properties: ^7.13.0 =&gt; 7.13.0
    @babel/plugin-proposal-optional-chaining: ^7.13.0 =&gt; 7.13.0
    @babel/preset-env: ^7.12.17 =&gt; 7.12.17
    @babel/preset-react: ^7.12.13 =&gt; 7.12.13
    @babel/preset-typescript: ^7.13.0 =&gt; 7.13.0
    babel-eslint: ^10.1.0 =&gt; 10.1.0
    babel-loader: ^8.2.2 =&gt; 8.2.2
    eslint: ^7.20.0 =&gt; 7.20.0
    jest: ^26.6.3 =&gt; 26.6.3
    webpack: ^5.24.0 =&gt; 5.24.0"><pre class="notranslate"><code class="notranslate"> System:
    OS: macOS 11.2.1
  Binaries:
    Node: 15.2.1 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/Cellar/node/15.2.1/bin/yarn
    npm: 6.14.8 - /usr/local/bin/npm
  npmPackages:
    @babel/plugin-proposal-class-properties: ^7.13.0 =&gt; 7.13.0
    @babel/plugin-proposal-optional-chaining: ^7.13.0 =&gt; 7.13.0
    @babel/preset-env: ^7.12.17 =&gt; 7.12.17
    @babel/preset-react: ^7.12.13 =&gt; 7.12.13
    @babel/preset-typescript: ^7.13.0 =&gt; 7.13.0
    babel-eslint: ^10.1.0 =&gt; 10.1.0
    babel-loader: ^8.2.2 =&gt; 8.2.2
    eslint: ^7.20.0 =&gt; 7.20.0
    jest: ^26.6.3 =&gt; 26.6.3
    webpack: ^5.24.0 =&gt; 5.24.0
</code></pre></div>
<p dir="auto">(After - broken):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" System:
    OS: macOS 11.2.1
  Binaries:
    Node: 15.2.1 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/Cellar/node/15.2.1/bin/yarn
    npm: 6.14.8 - /usr/local/bin/npm
  npmPackages:
    @babel/plugin-proposal-class-properties: ^7.13.0 =&gt; 7.13.0
    @babel/plugin-proposal-optional-chaining: ^7.13.0 =&gt; 7.13.0
    @babel/preset-env: ^7.13.5 =&gt; 7.13.5
    @babel/preset-react: ^7.12.13 =&gt; 7.12.13
    @babel/preset-typescript: ^7.13.0 =&gt; 7.13.0
    babel-eslint: ^10.1.0 =&gt; 10.1.0
    babel-loader: ^8.2.2 =&gt; 8.2.2
    eslint: ^7.20.0 =&gt; 7.20.0
    jest: ^26.6.3 =&gt; 26.6.3
    webpack: ^5.24.0 =&gt; 5.24.0"><pre class="notranslate"><code class="notranslate"> System:
    OS: macOS 11.2.1
  Binaries:
    Node: 15.2.1 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/Cellar/node/15.2.1/bin/yarn
    npm: 6.14.8 - /usr/local/bin/npm
  npmPackages:
    @babel/plugin-proposal-class-properties: ^7.13.0 =&gt; 7.13.0
    @babel/plugin-proposal-optional-chaining: ^7.13.0 =&gt; 7.13.0
    @babel/preset-env: ^7.13.5 =&gt; 7.13.5
    @babel/preset-react: ^7.12.13 =&gt; 7.12.13
    @babel/preset-typescript: ^7.13.0 =&gt; 7.13.0
    babel-eslint: ^10.1.0 =&gt; 10.1.0
    babel-loader: ^8.2.2 =&gt; 8.2.2
    eslint: ^7.20.0 =&gt; 7.20.0
    jest: ^26.6.3 =&gt; 26.6.3
    webpack: ^5.24.0 =&gt; 5.24.0
</code></pre></div>
<h3 dir="auto"><g-emoji class="g-emoji" alias="computer" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4bb.png">💻</g-emoji></h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Would you like to work on a fix?</li>
</ul>
<h3 dir="auto">How are you using Babel?</h3>
<p dir="auto">babel-loader (webpack)</p>
<h3 dir="auto">Input code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class App extends React.Component {
    constructor(props) {
        super(props);
        this.Test = function () {
            return &lt;&gt;123&lt;/&gt;;
        };
    }
    customerRender = () =&gt; {
        console.log(this.Test);
        return &lt;this.Test /&gt;;
    };
    render() {
        return &lt;div&gt;{this.customerRender()}&lt;/div&gt;;
    }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">App</span> <span class="pl-k">extends</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span> <span class="pl-kos">{</span>
    <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-smi">super</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">Test</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-k">return</span> <span class="pl-c1">&lt;</span><span class="pl-c1">&gt;</span>123<span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-c1">&gt;</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-c1">customerRender</span> <span class="pl-c1">=</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-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">Test</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-k">return</span> <span class="pl-c1">&lt;</span><span class="pl-s1">this</span><span class="pl-kos">.</span><span class="pl-v">Test</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">return</span> <span class="pl-c1">&lt;</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span><span class="pl-kos">{</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">customerRender</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">}</span><span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Configuration file name</h3>
<p dir="auto">.babelrc</p>
<h3 dir="auto">Configuration</h3>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
    &quot;presets&quot;: [
        [&quot;@babel/preset-env&quot;, { &quot;modules&quot;: false }],
        &quot;@babel/preset-react&quot;,
        &quot;@babel/preset-flow&quot;,
        [&quot;@babel/preset-typescript&quot;, { &quot;allowNamespaces&quot;: true }]
    ],
    &quot;plugins&quot;: [
        &quot;@babel/plugin-transform-runtime&quot;,
        [&quot;@babel/plugin-proposal-decorators&quot;, { &quot;legacy&quot;: true }]
    ]
}"><pre class="notranslate">{
    <span class="pl-ent">"presets"</span>: [
        [<span class="pl-s"><span class="pl-pds">"</span>@babel/preset-env<span class="pl-pds">"</span></span>, { <span class="pl-ent">"modules"</span>: <span class="pl-c1">false</span> }],
        <span class="pl-s"><span class="pl-pds">"</span>@babel/preset-react<span class="pl-pds">"</span></span>,
        <span class="pl-s"><span class="pl-pds">"</span>@babel/preset-flow<span class="pl-pds">"</span></span>,
        [<span class="pl-s"><span class="pl-pds">"</span>@babel/preset-typescript<span class="pl-pds">"</span></span>, { <span class="pl-ent">"allowNamespaces"</span>: <span class="pl-c1">true</span> }]
    ],
    <span class="pl-ent">"plugins"</span>: [
        <span class="pl-s"><span class="pl-pds">"</span>@babel/plugin-transform-runtime<span class="pl-pds">"</span></span>,
        [<span class="pl-s"><span class="pl-pds">"</span>@babel/plugin-proposal-decorators<span class="pl-pds">"</span></span>, { <span class="pl-ent">"legacy"</span>: <span class="pl-c1">true</span> }]
    ]
}</pre></div>
<h3 dir="auto">Current and expected behavior</h3>
<p dir="auto">Current: as <a href="https://babeljs.io/repl/#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&amp;build=&amp;builtIns=false&amp;corejs=false&amp;spec=false&amp;loose=true&amp;code_lz=MYGwhgzhAECCAO9oFMAeAXZA7AJjASsmMOgHQDCA9gLbyVbbrQDeAUNB9MPROgE4BXEpT4AKeH0rwIAShbtOiiAPjIxEqbIDcCxR3QALAJYRSAFWS9oAXmgAzAVhJH60UXLZ6v0PsnQC-LGgAHgA-AEYAJgBmYIB6UJ1vaABfJM4U3S4BXho1Qlw1Gzc5a1D5ZO4sCEoQZFIQSgBzUUMTc0t0GXSvX39AkLbTCysEntTx30KxDyzFPoCg4JwjADdQ5iHSYBz0PL4CnDV3FPiV9fHMlKA&amp;debug=false&amp;forceAllTransforms=true&amp;shippedProposals=false&amp;circleciRepo=&amp;evaluate=false&amp;fileSize=false&amp;timeTravel=true&amp;sourceType=module&amp;lineWrap=true&amp;presets=env%2Creact%2Cflow&amp;prettier=false&amp;targets=&amp;version=7.18.12&amp;externalPlugins=&amp;assumptions=%7B%7D" rel="nofollow">babel playground</a><br>
the output is:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// ...
var App = /*#__PURE__*/function (_React$Component) {
  _inheritsLoose(App, _React$Component);

  function App(props) {
    var _this;

    _this = _React$Component.call(this, props) || this;

    _this.customerRender = () =&gt; {
      console.log(_this.Test);
      return &lt;this.Test /&gt;;
    };

    _this.Test = function () {
      return &lt;&gt;123&lt;/&gt;;
    };

    return _this;
  }

  var _proto = App.prototype;

  _proto.render = function render() {
    return &lt;div&gt;{this.customerRender()}&lt;/div&gt;;
  };

  return App;
}(React.Component);"><pre class="notranslate"><span class="pl-c">// ...</span>
<span class="pl-k">var</span> <span class="pl-v">App</span> <span class="pl-c1">=</span> <span class="pl-c">/*#__PURE__*/</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">_React$Component</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-en">_inheritsLoose</span><span class="pl-kos">(</span><span class="pl-v">App</span><span class="pl-kos">,</span> <span class="pl-s1">_React$Component</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-k">function</span> <span class="pl-v">App</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">var</span> <span class="pl-s1">_this</span><span class="pl-kos">;</span>

    <span class="pl-s1">_this</span> <span class="pl-c1">=</span> <span class="pl-s1">_React$Component</span><span class="pl-kos">.</span><span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-s1">props</span><span class="pl-kos">)</span> <span class="pl-c1">||</span> <span class="pl-smi">this</span><span class="pl-kos">;</span>

    <span class="pl-s1">_this</span><span class="pl-kos">.</span><span class="pl-en">customerRender</span> <span class="pl-c1">=</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-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">_this</span><span class="pl-kos">.</span><span class="pl-c1">Test</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
      <span class="pl-k">return</span> <span class="pl-c1">&lt;</span><span class="pl-s1">this</span><span class="pl-kos">.</span><span class="pl-v">Test</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span><span class="pl-kos">;</span>

    <span class="pl-s1">_this</span><span class="pl-kos">.</span><span class="pl-en">Test</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-k">return</span> <span class="pl-c1">&lt;</span><span class="pl-c1">&gt;</span>123<span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-c1">&gt;</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span><span class="pl-kos">;</span>

    <span class="pl-k">return</span> <span class="pl-s1">_this</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>

  <span class="pl-k">var</span> <span class="pl-s1">_proto</span> <span class="pl-c1">=</span> <span class="pl-v">App</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">;</span>

  <span class="pl-s1">_proto</span><span class="pl-kos">.</span><span class="pl-en">render</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">return</span> <span class="pl-c1">&lt;</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span><span class="pl-kos">{</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">customerRender</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">}</span><span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span><span class="pl-kos">;</span>

  <span class="pl-k">return</span> <span class="pl-v">App</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">(</span><span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><code class="notranslate">this.Test</code> in <code class="notranslate">console.log</code> will transform to <code class="notranslate">_this.Test</code>, but <code class="notranslate">this.Test</code> in JSX tagName will not change(still without <code class="notranslate">_</code> prefix).<br>
So <code class="notranslate">this.Test</code> in JSX tagName will be undefined.<br>
React will throw an error: <code class="notranslate">React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined.</code>.</p>
<p dir="auto">Expected: <code class="notranslate">this.Test</code> in JSX tagName is defined.</p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>System:<br>
OS: macOS 12.2</li>
<li>Binaries:<br>
Node: 14.19.2<br>
Yarn: 1.22.15<br>
npm: 6.14.17</li>
<li>npmPackages:<br>
@babel/core: ^7.18.6 =&gt; 7.18.6<br>
@babel/plugin-proposal-class-properties: ^7.0.0 =&gt; 7.18.6<br>
@babel/plugin-proposal-decorators: ^7.0.0 =&gt; 7.18.6<br>
@babel/plugin-proposal-export-namespace-from: ^7.0.0 =&gt; 7.18.6<br>
@babel/plugin-proposal-function-sent: ^7.0.0 =&gt; 7.18.6<br>
@babel/plugin-proposal-json-strings: ^7.0.0 =&gt; 7.18.6<br>
@babel/plugin-proposal-numeric-separator: ^7.0.0 =&gt; 7.18.6<br>
@babel/plugin-proposal-throw-expressions: ^7.0.0 =&gt; 7.18.6<br>
@babel/plugin-syntax-dynamic-import: ^7.0.0 =&gt; 7.8.3<br>
@babel/plugin-syntax-import-meta: ^7.0.0 =&gt; 7.10.4<br>
@babel/plugin-transform-runtime: ^7.0.0 =&gt; 7.18.6<br>
@babel/preset-env: ^7.0.0 =&gt; 7.18.6<br>
@babel/preset-flow: ^7.0.0 =&gt; 7.18.6<br>
@babel/preset-react: ^7.0.0 =&gt; 7.18.6<br>
@babel/preset-typescript: ^7.18.6 =&gt; 7.18.6<br>
babel-eslint: ^10.0.3 =&gt; 10.1.0<br>
babel-jest: ^28.1.3 =&gt; 28.1.3<br>
babel-loader: ^8.0.0 =&gt; 8.2.5<br>
eslint: ^7.1.0 =&gt; 7.32.0<br>
webpack: ^5.40.0 =&gt; 5.73.0</li>
</ul>
<h3 dir="auto">Possible solution</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional context</h3>
<p dir="auto"><em>No response</em></p>