Reputation: 31
I have setup the Stencil CLI and it was working fine, until a few weeks ago, when it started giving me the error:
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
I have updated the node version, reinstalled npm multiple times but with no effect. Also have run the commands mentioned above.
Can someone please help me in fixing this issue? Thanks a lot! Shivam
Upvotes: 2
Views: 1942
Reputation: 283
You only have to add corejs: 2
or corejs: 3
to your preset options depending on what version you're using:
In babel.config.js
const presets = [['@babel/preset-env', { useBuiltIns: 'usage', corejs: 2 }]];
module.exports = { presets };
In .babelrc
{
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
"corejs": 2
}
]
]
}
You can read about other allowed values here: https://babeljs.io/docs/en/next/babel-preset-env#corejs
I made some notes and a working configuration of babel7 here: https://github.com/hdt94/notes-babel
Hope this helps
Upvotes: 6
Reputation: 46
This issue report on babel's github repo might helpful:
Also, several commenters successfully stopped the warnings by making the changes described in this vuejs issue report:
Hope that helps,
A
Upvotes: 1