Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Duplicate identifier declaration in minified bundle #9474

Closed
cimchd opened this issue Mar 17, 2024 · 0 comments
Closed

Duplicate identifier declaration in minified bundle #9474

cimchd opened this issue Mar 17, 2024 · 0 comments
Labels
bug Something isn't working transpiler parser || printer

Comments

@cimchd
Copy link

cimchd commented Mar 17, 2024

What version of Bun is running?

1.0.30+1424a196f

What platform is your computer?

Linux 5.15.146.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

This is the content of the file to be bundled:

// importmaps/react-dom-server.ts
import defaultImport from 'react-dom/server';
export {renderToNodeStream,renderToReadableStream,renderToStaticMarkup,renderToStaticNodeStream,renderToString,version} from 'react-dom/server';
export default defaultImport;

Here are the bun bundler options:

Bun.build({
  entrypoints: [`./importmaps/react-dom-server.ts`],
  naming: '[name].js',
  outdir: './dist',
  external: ['react'],
  minify: true,
  target: 'browser',
}),

This is the error message (minified code formatted with VS Code):

image

What is the expected behavior?

No duplicate Identifier, no error message when using the minified code in the browser.

What do you see instead?

image

Additional information

No response

@cimchd cimchd added the bug Something isn't working label Mar 17, 2024
@cimchd cimchd changed the title Redeclaration of Identifier in minified bundle Duplicate identifier declaration in minified bundle Mar 17, 2024
@Electroid Electroid added the transpiler parser || printer label Mar 19, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working transpiler parser || printer
Projects
None yet
Development

No branches or pull requests

3 participants