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
Compat babel interop helper code. #1326
Comments
After an initial reading of this code, this seems like a bug in Babel's |
This was fixed in Babel with babel/babel#12838. Please upgrade to v7.14.0 |
Thanks for the link! Ok, I'm going to close this issue as "working as intended" then. This is a Babel bug that has already been fixed, so you need to update your version of Babel. |
Thanks, @jridgewell, @evanw do we know since which version esbuild stopped to work with such Babel scrips? It was working for me using ViteJS and stopped to work I think bumping ViteJS version and within that upgrade, the version of esbuild from v0.9 to v0.11 too. The problem I am facing is that the error is in the roof of a 3rd party dependency, it is happening when I import components published using an earlier version of Babel. Is there any workaround until they upgrade the Babel version? |
Description
Babel compiled esm code will add interop module code. This is common usaged at react ecosystem because
create-react-app
use bable compiled code.But this interop code will throw error after esbuild bundle. Here is error trace.
I tracked this issue found this caused by
__export
, it only add getter for export namespace, here is code.Same issue also happend at ts, but microsoft/TypeScript#37236 is fixed this. So i think it should be issue at esbuild.
Original issue: vitejs/vite#3437
Babel Input
Babel Output
The text was updated successfully, but these errors were encountered: