babel: Can't find private variable @derivedConstructor (Safari iOS 10.3.1)

Bug Report

Current Behavior

Can't find private variable @derivedConstructor error on Safari iOS 10.3.1

Input Code

The following code generated an error on Safari iOS 10.3.1:

before Babel:

someFunction = async () => {
  ...
}

after Babel:

_defineProperty(this, "someFunction", async (props, state) => {
  ...
}

Expected behavior/code

The example is working on Safari iOS 10.0 and Safari iOS 11

Babel Configuration (.babelrc, package.json, cli command)

const pkg = require('./package.json');

module.exports = api => {
  const env = api.env();

  const presets = [
    [
      '@babel/env',
      {
        modules: false,
        useBuiltIns: 'entry',
        { targets: { esmodules: true },
      },
    ],
    '@babel/react',
    '@babel/typescript',
  ];

  const plugins = [
    '@babel/proposal-class-properties',
    '@babel/plugin-syntax-dynamic-import',
  ].filter(Boolean);

  return {
    presets,
    plugins,
  };
};

Environment

  • Babel version(s): Latest for all babel-related packages:
    "@babel/core": "7.2.2",
    "@babel/plugin-proposal-class-properties": "7.2.3",
    "@babel/plugin-syntax-dynamic-import": "7.2.0",
    "@babel/plugin-transform-react-jsx-source": "7.2.0",
    "@babel/preset-env": "7.2.3",
    "@babel/preset-react": "7.0.0",
    "@babel/preset-typescript": "7.1.0",
  • Node/npm version: Node 10.15.0 / Yarn 1.13.0
  • OS: Mac OSX 10.14.2
  • Monorepo: yes
  • How you are using Babel: loader via webpack

Possible Solution

Additional context/Screenshots

Please let me know if I can help in any way!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Hey I know this should be closed but I am running a test on iOS 10.3.3 Using babel 7.4.4 and preset-env 7.4.4

could it be the bug is back? Or might it have to do with other issues?

I have a PR for this, will get it up tonight or tomorrow.

Do you want me to do it? If so, would you mind providing me the exact commit you want me to use? 😃

@aaronabramov next step for fixing this issue - updating compat-table here, calling this script and creating a pull request with the result -)

Sure, created an issue on the compat-table repo: https://github.com/kangax/compat-table/issues/1419