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" does not embed binaries from node_modules correctly #15374

Open
buzzy opened this issue Nov 23, 2024 · 0 comments
Open

"bun build" does not embed binaries from node_modules correctly #15374

buzzy opened this issue Nov 23, 2024 · 0 comments
Labels
bug Something isn't working bundler Something to do with the bundler

Comments

@buzzy
Copy link

buzzy commented Nov 23, 2024

What version of Bun is running?

1.1.36+ededc168c

What platform is your computer?

Linux 6.1.0-9-amd64 x86_64 x86_64

What steps can reproduce the bug?

  1. Install sharp - https://github.com/lovell/sharp
bun install sharp
  1. import and use the sharp library
const sharp = require('sharp');
const semiTransparentRedPng = await sharp({
  create: {
    width: 48,
    height: 48,
    channels: 4,
    background: { r: 255, g: 0, b: 0, alpha: 0.5 }
  }
})
  .png()
  .toBuffer();
  1. Compile a binary with bun build
bun build --compile --minify --smol --sourcemap index.ts --outfile test
  1. Run the "test" binary in the current directory that also has the node_modules directory. It will work
./test
  1. Copy the "test" file to another directory and run it. It will fail, as it does not find node_modules dir
cp test /tmp
/tmp/test

What is the expected behavior?

That the resulting binary from "bun build" will include all necessary files, including potential binaries found in node_modules.

What do you see instead?

The resulting binary from "bun build" is trying to run external binaries in node_modules.

Additional information

No response

@buzzy buzzy added bug Something isn't working needs triage labels Nov 23, 2024
@buzzy buzzy changed the title "bun build" does embed binaries from node_modules correctly "bun build" does not embed binaries from node_modules correctly Nov 23, 2024
@RiskyMH RiskyMH added bundler Something to do with the bundler and removed needs triage labels Nov 24, 2024
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
Projects
None yet
Development

No branches or pull requests

2 participants