Issue 1:
Bug Report

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.

We are using "browserslist": "last 2 Chrome versions" in package.json, with this babelrc:

{
"presets": [
"@babel/preset-env",
"@babel/preset-typescript",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-optional-chaining"
]
}

Current behavior

Previous with 7.12.7, no issues seen.

Expected behavior

7.13.5 should continue to work

Environment

(Before - Working):

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 => 7.13.0
@babel/plugin-proposal-optional-chaining: ^7.13.0 => 7.13.0
@babel/preset-env: ^7.12.17 => 7.12.17
@babel/preset-react: ^7.12.13 => 7.12.13
@babel/preset-typescript: ^7.13.0 => 7.13.0
babel-eslint: ^10.1.0 => 10.1.0
babel-loader: ^8.2.2 => 8.2.2
eslint: ^7.20.0 => 7.20.0
jest: ^26.6.3 => 26.6.3
webpack: ^5.24.0 => 5.24.0

(After - broken):

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 => 7.13.0
@babel/plugin-proposal-optional-chaining: ^7.13.0 => 7.13.0
@babel/preset-env: ^7.13.5 => 7.13.5
@babel/preset-react: ^7.12.13 => 7.12.13
@babel/preset-typescript: ^7.13.0 => 7.13.0
babel-eslint: ^10.1.0 => 10.1.0
babel-loader: ^8.2.2 => 8.2.2
eslint: ^7.20.0 => 7.20.0
jest: ^26.6.3 => 26.6.3
webpack: ^5.24.0 => 5.24.0

Issue 2:
💻

Would you like to work on a fix?

How are you using Babel?

babel-loader (webpack)

Input code

class App extends React.Component {
constructor(props) {
super(props);
this.Test = function () {
return <>123</>;
};
}
customerRender = () => {
console.log(this.Test);
return <this.Test />;
};
render() {
return <div>{this.customerRender()}</div>;
}
}

Configuration file name

.babelrc

Configuration

{
"presets": [
["@babel/preset-env", { "modules": false }],
"@babel/preset-react",
"@babel/preset-flow",
["@babel/preset-typescript", { "allowNamespaces": true }]
],
"plugins": [
"@babel/plugin-transform-runtime",
["@babel/plugin-proposal-decorators", { "legacy": true }]
]
}

Current and expected behavior

Current: as babel playground

the output is:

// ...
var App = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(App, _React$Component);

function App(props) {
var _this;

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

_this.customerRender = () => {
console.log(_this.Test);
return <this.Test />;
};

_this.Test = function () {
return <>123</>;
};

return _this;
}

var _proto = App.prototype;

_proto.render = function render() {
return <div>{this.customerRender()}</div>;
};

return App;
}(React.Component);

this.Test in console.log will transform to _this.Test, but this.Test in JSX tagName will not change(still without _ prefix).

So this.Test in JSX tagName will be undefined.

React will throw an error: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined..

Expected: this.Test in JSX tagName is defined.

Environment

System:

OS: macOS 12.2

Binaries:

Node: 14.19.2

Yarn: 1.22.15

npm: 6.14.17

npmPackages:

@babel/core: ^7.18.6 => 7.18.6

@babel/plugin-proposal-class-properties: ^7.0.0 => 7.18.6

@babel/plugin-proposal-decorators: ^7.0.0 => 7.18.6

@babel/plugin-proposal-export-namespace-from: ^7.0.0 => 7.18.6

@babel/plugin-proposal-function-sent: ^7.0.0 => 7.18.6

@babel/plugin-proposal-json-strings: ^7.0.0 => 7.18.6

@babel/plugin-proposal-numeric-separator: ^7.0.0 => 7.18.6

@babel/plugin-proposal-throw-expressions: ^7.0.0 => 7.18.6

@babel/plugin-syntax-dynamic-import: ^7.0.0 => 7.8.3

@babel/plugin-syntax-import-meta: ^7.0.0 => 7.10.4

@babel/plugin-transform-runtime: ^7.0.0 => 7.18.6

@babel/preset-env: ^7.0.0 => 7.18.6

@babel/preset-flow: ^7.0.0 => 7.18.6

@babel/preset-react: ^7.0.0 => 7.18.6

@babel/preset-typescript: ^7.18.6 => 7.18.6

babel-eslint: ^10.0.3 => 10.1.0

babel-jest: ^28.1.3 => 28.1.3

babel-loader: ^8.0.0 => 8.2.5

eslint: ^7.1.0 => 7.32.0

webpack: ^5.40.0 => 5.73.0

Possible solution

No response

Additional context

No response