-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Unexpected "With useBuiltins
option, required direct setting of corejs
option" with default configuration
#2819
Comments
Seems to be due to babel/babel#7646 (comment) My build is broken as well, thanks to Babel 7.4.0. I don't think it's a Parcel issue but I'd really like to hear what the solution is. |
" Didn't realize the change was so recent. Looks like Babel is making a soft API change in 7.4.0. I doubt they'll turn back on that, so unfortunately I think it has become a Parcel issue. |
See this stackoverflow question for some solutions/approaches. |
I tried to lock Babel core to ~7.3 but the message still shows up |
我的 Babel 版本是 7.0.0 也是这个问题 。。。。。。 |
I am not sure the severity of this issue, is your built really "broken" as not able run stably? Is this supposed to just a deprecation warning which should be harmless for now? I have a production project and its build is affected by this but it seems to work fine, I hope things actually are fine. |
For some reason my
Despite installing Rolled back to |
See the same issue by using "cnpm install" today, however, using "npm install" is ok for me. |
My build is broken. It seems to be due to babel/babel#9616 I fixed it by adding
Other links discussing this problem: |
In Babel that is just a log message, not an error. If your build is broken, it's because of something else. |
same issue here even on babel@6😠 |
Can you show an example which explains the problem? It should work. @Maximilianos Doesn't Babel 7.4.0 work if you do not upgrade to |
@nicolo-ribaudo perhaps because babel-preset-env explicitly depends on core-js 3 itself? https://github.com/babel/babel/blob/master/packages/babel-preset-env/package.json#L58 |
It shouldn't be a problem: the
And the user code will end up loading Anyway, maybe it's possible to make |
So I tried both
|
Did you try to |
@nicolo-ribaudo yes this is my babelrc file |
Unfortunately, that won't work since Parcel overrides the preset-env config with its own. And we have no way of knowing what corejs version to use. This isn't something users should need to worry about anyway. I think the warning needs to be removed. Just use core-js 2 unless it is specified. |
(btw this overriding behavior is bad and it's going away in parcel 2, but it's what we have right now) |
Its not just a warning in my case even when i remove the babelrc file with core-js@2 installed i break on building :(
|
I believe that is probably a separate issue with babel 7.4, unrelated to the warning. |
So I tried to force @babel/parser": "<7.4.0 without any luck. Any ideas of a workaround that actually works ? |
Probably babel/babel#9589 |
@devongovett Thanks for your help! I am not experienced with the inner workings of babel or parcel I played around with web-pack today and had no issues building my app. I prefer parcel and love how easy it is to set up. Do you think it would be a wise choice to switch back over to webpack until this issue is resolved ? |
This isn't an issue with parcel, it's a bug in babel. You'd have the same issues with webpack. |
yep, same issue. |
Ok, let me explain the current situation: The fact that it generates those imports means that users need to have Yesterday Even if the necessity to An example of a project which relied on Relying on npm hoisting won't work anymore, and we need to make people aware of the presence of I don't know if Thanks for reporting the other issue, I'm looking at it. |
Also, 53c09b3 will only work until some other dependency will depend on |
I only installed version 3.0.0 of "core-js".(npm i -g core-js) My version of "core-js" in "package.json": and, My Babel configuration has the following information: When the @babel/preset-env and @babel/plugin-transform-runtime options are set the "corejs" option, the value is: If only the "corejs" option of "@babel/plugin-transform-runtime" is set, and the value is: But if me just set the "corejs" option of "@babel/preset-env", the value is: |
If you want to use core-js with Babel/runtime you need to install Anyway (at everyone) this issue is turning in a Babel-related support not related to Parcel. Please ask these questions in the Babel repo. |
Exactly!!! |
please check these resources below on the reasoning behind this problematic babel bug: - https://stackoverflow.com/questions/55251983/what-does-this-error-mean-with-usebuiltins-option-required-direct-setting-of - parcel-bundler/parcel#2819 - parcel-bundler/parcel@53c09b3
… version (Lyrkan) This PR was merged into the master branch. Discussion ---------- Set useBuiltIns to false by default and allow to set core-js version While working on #544 I noticed that the latest version of `@babel/preset-env` displayed a warning (which luckily made [one of the tests](https://travis-ci.org/symfony/webpack-encore/jobs/509655320) fail): ``` 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 ``` This is related to the `core-js` 3 update that happened recently (see babel/babel#7646). As explained in parcel-bundler/parcel#2819 (comment) the issue is that users are normally supposed to add `core-js` in their root `package.json` when setting `useBuiltIns` (which is currently already set by Encore to `entry` by default). This is a problem for us since it means that: * we are requiring users to add `core-js` to their project by default (or manually setting `useBuiltIns` to `false`) * if they do they'll still have a warning because the new `corejs` option of `@babel/preset-env` won't be set (we can't do that because we won't know which version they choose to install). For now I suggest that we set `useBuiltIns` to `false` by default and add a new option to `Encore.configureBabel()` that allows to set the `corejs` option. Commits ------- 85896ef Set useBuiltIns to false by default and allow to set corejs version
I just use these.
you can also try update parcel,it maybe deal this bug
![image](https://user-images.githubusercontent.com/30255395/56632942-bd5eb300-668e-11e9-90ee-4be3145fe240.png)
|
@devongovett With the next release switching back to the latest Babel, is the corejs situation resolved now? |
Several warnings are emitted during build due to parcel-bundler/parcel#2819 so pin parcel to a version without the issues.
Confirmed that this issue is solved with 1.12.3 of parcel |
Sorry, just realized that 1.12.3 only rolled back the version of babel. I think I should keep this open until there is a definitive solution. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
Upgrading made this go away:
|
🐛 bug report
Calling
parcel build <entry point>
with all default configuration results in a warning from@babel/preset-env
.🎛 Configuration (.babelrc, package.json, cli command)
.babelrc
:none
package.json
:yarn run parcel build src/index.html
🤔 Expected Behavior
The build should complete with no errors or warnings
😯 Current Behavior
The build completes, but it emits the following warning:
With `useBuiltIns` option, required direct setting of `corejs` option
💁 Possible Solution
This warning appears to come from @babel/preset-env. It seems like it might be possible to avoid by specifying
corejs
appropriately in transforms/babel.js🔦 Context
I'm trying to bootstrap a project which requires no extra configuration than what Parcel comes with out of the box. It would be helpful for this warning to be resolved without having to add extra non-functional Babel configuration (several attempts at configuring correctly have failed).
💻 Code Sample
The following files with the addition of the above configuration should be enough to reproduce the issue.
src/index.html
:src/index.js
:🌍 Your Environment
The text was updated successfully, but these errors were encountered: