-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Bundler Duplicate Exports #5344
Comments
oh i think i know why this happens |
I can reproduce this as well! Been having lots of issues in my repo because of it and having to do a lot of weird workarounds. |
Doesn't seem to happen when you enable minification |
Enabling minification seems to cause issues with JSX runtime imports not being added. Once this is fixed I'll explore getting a reproduction of the JSX issue well. |
That's a workaround |
I have a hunch as to why minifying it solves the issue. I got the following output when compiling my own test case, with the files ./dependency.ts and ./main.ts, with the function o() {
console.log("foobar");
}
export {
o as foobar
};
export { o as a }; To contrast, when I compile the dependency.ts file standalone, lines 7,8 are removed. function o() {
console.log("foobar");
}
export {
o as foobar
}; When compiling a file and its dependency under the |
I just hit this too. export {
postJson,
post,
okFetch,
baseFetch
};
export { ContentTypes, REDIRECT_CODE, postJson }; Note how I see, because one of the other files also wants to import
The first set of exports is for the browser, the 2nd is for the other scripts. |
Any update on this? |
Bump for visibility |
Any updates? Also occurring in recent version, related issue #10631 |
I just ran into this issue as well, confirm still happening as of |
Still there in 1.1.37 and blocking for bun adoption in our company's projects |
What version of Bun is running?
1.0.1
What platform is your computer?
Darwin 22.5.0 arm64 arm
What steps can reproduce the bug?
Double exports seems to arise when one entrypoint is re-exporting from another entrypoint.
A reproduction can be found here: https://github.com/jacob-ebey/bun-bug-reproductions/tree/main/bugs/bundler-double-exports
What is the expected behavior?
Entrypoint output is a valid ES module.
What do you see instead?
Duplicate exports in the
dist/entry-b.js
that ends up looking something like:Additional information
I'm going to be using https://github.com/jacob-ebey/bun-bug-reproductions/ as a general bug-reproduction location for anything else I run across.
The text was updated successfully, but these errors were encountered: