Vue-cli: Unknown option: .useBuiltIns. in babel.config.js

Created on 25 Sep 2018  路  6Comments  路  Source: vuejs/vue-cli

Version

3.0.1

Reproduction link

https://github.com/latel/vue-bad-babel

Node and OS info

Node 10.4.0 / npm 3.10.6 / Windows 7

Steps to reproduce

npm run build

What is expected?

everything works alright

What is actually happening?

$ npm run build

> [email protected] build F:\vue-bad-babel
> vue-cli-service build


\  Building for production...Starting type checking service...
Using 1 worker with 2048MB memory limit
|  Building for production...

 ERROR  Failed to compile with 1 errors                                                                                                                                                                           13:10:42

 error  in ./src/main.ts

Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
[BABEL] F:\vue-bad-babel\src\main.ts: Unknown option: .useBuiltIns. Check out http://babeljs.io/docs/usage/options/ for more information about options.

    at buildUnknownError (F:\vue-bad-babel\node_modules\@babel\core\lib\config\validation\options.js:113:11)
    at Object.keys.forEach.key (F:\vue-bad-babel\node_modules\@babel\core\lib\config\validation\options.js:99:57)
    at Array.forEach (<anonymous>)
    at validate (F:\vue-bad-babel\node_modules\@babel\core\lib\config\validation\options.js:69:21)
    at instantiatePreset (F:\vue-bad-babel\node_modules\@babel\core\lib\config\full.js:242:36)
    at cachedFunction (F:\vue-bad-babel\node_modules\@babel\core\lib\config\caching.js:42:19)
    at loadPresetDescriptor (F:\vue-bad-babel\node_modules\@babel\core\lib\config\full.js:233:45)
    at config.presets.map.descriptor (F:\vue-bad-babel\node_modules\@babel\core\lib\config\full.js:68:19)
    at Array.map (<anonymous>)
    at recurseDescriptors (F:\vue-bad-babel\node_modules\@babel\core\lib\config\full.js:66:38)

 @ multi ./src/main.ts

 ERROR  Build failed with errors.

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v10.4.0
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'vue-cli-service build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the vue-bad-babel package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     vue-cli-service build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs vue-bad-babel
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls vue-bad-babel
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     F:\vue-bad-babel\npm-debug.log

https://cli.vuejs.org/guide/browser-compatibility.html#browserslist

as documented here, all @babel/preset-env options should available through @vue/babel-preset-app.

Most helpful comment

my babel config format is error.

Should be [["@vue/app",{useBuiltIns: "entry"}]]

Not ["@vue/app",{useBuiltIns: "entry"}]

All 6 comments

my babel config format is error.

Should be [["@vue/app",{useBuiltIns: "entry"}]]

Not ["@vue/app",{useBuiltIns: "entry"}]

my babel config format is error.

Should be [["@vue/app",{useBuiltIns: "entry"}]]

Not ["@vue/app",{useBuiltIns: "entry"}]

thank you

my babel config format is error.

Should be [["@vue/app",{useBuiltIns: "entry"}]]

Not ["@vue/app",{useBuiltIns: "entry"}]

Thanks!

what a ridiculous issue; @latel you're the man! thanks for the help! this should def. be specified in the docs.

As seen on official Babel docs:
https://babeljs.io/docs/en/presets#preset-options
https://babeljs.io/docs/en/babel-preset-env#browserslist-integration

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "useBuiltIns": "entry"
      }
    ]
  ]
}
Was this page helpful?
0 / 5 - 0 ratings