Skip to content
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

bun build breaks html-escaper #17454

Closed
koakuma-chan opened this issue Feb 19, 2025 · 0 comments · Fixed by #17468
Closed

bun build breaks html-escaper #17454

koakuma-chan opened this issue Feb 19, 2025 · 0 comments · Fixed by #17468
Labels
bug Something isn't working bundler Something to do with the bundler confirmed bug We can reproduce this issue

Comments

@koakuma-chan
Copy link

What version of Bun is running?

1.2.3-canary.120+f3d18fc58

What platform is your computer?

Linux 5.15.167.4-microsoft-standard-WSL2 x86_64 unknown

What steps can reproduce the bug?

  1. git clone https://github.com/koakuma-chan/nasty-neptune
  2. cd nasty-neptune
  3. bun install --frozen-lockfile
  4. bun run astro build
  5. bun build dist/server/entry.mjs --target=node | grep html-escaper -A 1

What is the expected behavior?

// node_modules/html-escaper/esm/index.js
var { replace } = "", ca, esca, pe = (m) => esca[m], escape = (es) => replace.call(es, ca, pe);

What do you see instead?

// node_modules/html-escaper/esm/index.js
var replace = "", ca, esca, pe = (m) => esca[m], escape = (es) => replace.call(es, ca, pe);

Additional information

Basically, bun build turns this

const {replace} = '';

https://github.com/WebReflection/html-escaper/blob/c6e2b50d7b6f486afb3ddc92bfcfec89857b75d7/esm/index.js#L23

into this

const replace = '';
@koakuma-chan koakuma-chan added bug Something isn't working needs triage labels Feb 19, 2025
koakuma-chan added a commit to mayo-dayo/app that referenced this issue Feb 19, 2025
@pfgithub pfgithub added bundler Something to do with the bundler confirmed bug We can reproduce this issue and removed needs triage labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bundler Something to do with the bundler confirmed bug We can reproduce this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants