Core-js: Missing files: core-js/modules/es.object.to-string

Created on 7 May 2019  路  2Comments  路  Source: zloirock/core-js

Using @babel/preset-env with core-js@3. Below is my babel config

module.exports = api => {
  const config = {
    presets: [
      [
        '@babel/preset-env',
        {
          modules: api.env('test') ? 'commonjs' : false,
          useBuiltIns: 'usage',
          corejs: 3,
          exclude: ['es.promise'],
          targets: { browsers: ['Android >= 4.4', 'iOS >= 10'] }
        }
      ],
      '@babel/preset-typescript'
    ],
    plugins: [
      '@babel/plugin-proposal-class-properties',
      '@babel/plugin-proposal-object-rest-spread',
      '@babel/plugin-transform-runtime'
    ]
  }

  return config
}

and the output code is like below

import _regeneratorRuntime from '@babel/runtime/regenerator';
import 'regenerator-runtime/runtime';
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
import 'core-js/modules/es6.regexp.to-string';
import 'core-js/modules/es6.object.to-string';
import _objectSpread from '@babel/runtime/helpers/objectSpread';
...

But there is no core-js/modules/es6.object.to-string file at all.

Most helpful comment

rm -rf node_modules
yarn

All 2 comments

@lili21 how did you resolve it?

rm -rf node_modules
yarn

Was this page helpful?
0 / 5 - 0 ratings