New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify warning source about underspecified corejs option in preset-env. #12402
Clarify warning source about underspecified corejs option in preset-env. #12402
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/33649/ |
5e4591f
to
c0ac148
Compare
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 8fd93bc:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I really like the links pointing to the docs for more context.
"\n[babel-preset-env]" + | ||
"\nWARNING: We noticed you're using the `useBuiltIns` option without declaring a " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer something like
"\n[babel-preset-env]" + | |
"\nWARNING: We noticed you're using the `useBuiltIns` option without declaring a " + | |
"\nWARNING (@babel/preset-env): We noticed you're using the `useBuiltIns` option without declaring a " + |
"\n[babel-preset-env]" + | ||
"\nThe `corejs` option only has an effect when the `useBuiltIns` option is not `false`\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also here:
"\n[babel-preset-env]" + | |
"\nThe `corejs` option only has an effect when the `useBuiltIns` option is not `false`\n", | |
"\nWARNING (@babel/preset-env): The `corejs` option only has an effect when the `useBuiltIns` option is not `false`\n", |
(this is not technically a warning, but since it's probably an error in the user's config it's good to mark it as such).
Thanks for the review! I'll work on those changes. |
Okay, changes are up. |
Thanks! |
…nv. (babel#12402) * Clarify these warnings are for babel-preset-env. * Fix lint. * Fix specs. * Fix merge conflict. * PR feedback.
I stumbled across the warning about using
useBuiltIns
without declaring a core-js version. It took me a fair bit of hunting before I realized it belonged to preset-env, and how to fix the issue. From the docs, I thought all I needed to do was install the package, which (I now see obviously) didn't fix the problem.I'm not sure if some expanded logging like this would be desired, but I could imagine it'll reduce confusion for people by adding a little tag to the warning printout, so they know this is coming from this package. I've definitely run into this error multiple times when starting projects and was confused as to what to do.
I think I got all the tests to pass, I was getting some issues with
caniuse-lite
being outdated and complaining about it, but I couldn't seem to make it go away. Sorry if I got it wrong, this is my first time contributing to babel.