Fix babel useBuiltIns core-js warning
See original GitHub issue- I confirm that this is an issue rather than a question.
Bug report
When running ‘vanilla’ build see the following warning in the console
WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.
You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:
npm install --save core-js@2 npm install --save core-js@3
yarn add core-js@2 yarn add core-js@3
Version
@vuepress/core@1.0.0-alpha.44
Steps to reproduce
$ mkdir test; cd test; npm init # accept defaults $ npm install vuepress@next $ echo ‘# Hello VuePress’ > README.md $ ./node_modules/.bin/vuepress build
What is expected?
no warnings about useBuiltIns
What is actually happening?
scary warning 😉
actually, some additional information on how I stumbled across this. In my case adding nuxt@2.5.0 (used core-js 3) caused the “vupress build” to fail. Whereas adding nuxt@2.5.1 (uses core-js 2) makes the vuepress build error and warning go away. Related to https://github.com/nuxt/nuxt.js/issues/5313
Other relevant information
- Your OS: Windows 10
- Node.js version: 8.15.1
- Browser version: n/a
- Is this a global or local install? local
- Which package manager did you use for the install? npm 6.4.1
- Does this issue occur when all plugins are disabled? unsure, only using defaults
Issue Analytics
- State:
- Created 4 years ago
- Reactions:24
- Comments:12
Top Results From Across the Web
What does this error mean? With `useBuiltIns` option, required ...
Getting the same issue. Resolved it by installing core-js as a top level dependency and then adding it as an option to .babelrc...
Read more >WARNING: We noticed you're using the `useBuiltIns` option ...
WARNING (@babel/preset-env): We noticed you're using the `useBuiltIns` option without declaring a core-js version.
Read more >babel/preset-env
This behavior is deprecated because it isn't possible to use @babel/polyfill with different core-js versions. useBuiltIns: 'usage'. Adds specific imports for ...
Read more >babel-loader - webpack
ProvidePlugin({ 'Promise': 'bluebird' }), // ... The following approach will not work either: require('@babel/runtime/core-js ...
Read more >What you don't know about BabelJS preset-env - PerimeterX
The preset-env useBuiltins flag determines if babel should always add corejs polyfills, add them once per file or per usage of a particular ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Adding
"corejs": "3.0.0"
in the.babelrc
file turned off the warnings.I see this on the latest vue cli and vue js SPA build too.