Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does this error mean? With `useBuiltIns` option, required direct setting of `corejs` option

Tags:

npm

babeljs

I just started getting this error in my static assets build with parcel.js. It works locally but my build on Heroku is erroring and I'm not sure if it's related.

like image 441
springbok Avatar asked Mar 20 '19 00:03

springbok


1 Answers

Getting the same issue. Resolved it by installing core-js as a top level dependency and then adding it as an option to .babelrc

npm install --save core-js@3

Then updated my .babelrc file to include it as an option:

 {
  "presets": [
    [ "@babel/preset-env", {
      "useBuiltIns": "entry",
      "corejs": 3
    }]
  ],
  "plugins": [
    "@babel/plugin-syntax-dynamic-import",
    "@babel/plugin-syntax-import-meta",
    ["@babel/plugin-proposal-class-properties", { "loose": false }],
    "@babel/plugin-proposal-json-strings"
  ]
}

I referenced the docs here to figure it out https://babeljs.io/docs/en/babel-preset-env#usebuiltins

like image 92
T-G Avatar answered Nov 04 '22 17:11

T-G