-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
@babel/runtime 7.13.3 unexpected cjs modules in esm modules #12861
Comments
Hey @afc163! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite." |
Is this causing a problem? |
The esm module unable to import the cjs module. |
Package exports is not supported in webpack 4 babel/packages/babel-runtime/package.json Lines 190 to 194 in f47737c
|
It is causing a problem. I am using Babel with Webpack and resuting source is like As you see, I got module instead of function in _toConsumableArray variable. The usage of it (generated by transform-runtime) obviously fails.
Maybe there is a setting somewhere to fix this, but it's definetly a breaking change for me, not just a minor update. Babel 7.12 works perfectly fine. |
I have babel "7.12.17" with below configuration and everything was working fine till yesterday.
After "7.13.0" release I am continuously getting error, where I am trying to extend a Class but not able to do so.
In previous version's I can see Any suggestions? Please |
As temporary fix you can rollback to 7.12.x. Replace "^7.12.17" with "~7.12.17" for all @babel packages in your package.json and reinstall dependencies. |
Yes Thanks @KACAH Just did that. But Why is this happening, I mean what causing polyfill not injecting? |
@dollysingh3192 We unified our polyfill implementations for corejs2 and corejs3, and it caused problems. |
For people with the corejs problemPlease go to #12863, this is a different issue! |
@nicolo-ribaudo Thanks for your response and the link in above comment. Is there any helpful link where we can read more on detail on this unification implementation? Thanks again! |
@KACAH Your problem is the opposite: your bundle is requiring an ESM file in CJS. Could you create a small repo that shows the error? @372623460jh your error will be fixed by #12883 |
My problem seems to be fixed after this commit. So the build works fine again after Here is a small repo with pre-fix problem demo, just for a history I guess. BTW problem does not appear without |
I'm glad that it was solved, I'm sorry it took us a few attempts to finally get the |
Just found out documentation on
Not sure if this is or will be important, but your |
Yes that was a deliberate decision: when running in Node, we always want to load the CommonJS file. Otherwise you could end up running two different "copies" of the same helper: the ESM one when using Unfortunately in webpack there could still be duplication between ESM and CJS, but it's not something that we can fix until Babel 8 (and it was already happening with older |
Bug Report
Current behavior
https://unpkg.com/@babel/runtime@7.13.2/helpers/createSuper/_index.mjs
Expected behavior
Should it be?
like: https://unpkg.com/browse/@babel/runtime@7.12.0/helpers/esm/createSuper.js
Environment
webpack
,rollup
,parcel
,babel-register
]Possible Solution
Additional context
The text was updated successfully, but these errors were encountered: