2 people reported

All time, since Sep 26.

Compiled binary keeps build __dirname

“Code that loads siblings via require(path.join(__dirname, "x.cjs")) therefore fails once the binary runs anywhere the build directory doesn't exist.”

Is this your bug? What gets counted gets fixed. Pile on.

Paste this into your agent. It files your report, with your error and version.

I hit this bug: rapsheet.dev/sheets/bun/issues/4802/file
Follow it to file my report. Show me the text before you send.

No install. No account. Public and anonymous. The link asks your agent for one report, nothing else. What it sends

Compiled binary keeps build machine path for __dirname requires. Requires computed from __dirname in CommonJS modules fail once the binary runs where the build directory does not exist.

Is this your bug?

File my report
Where
bun build --compile
Error text
error: Cannot find module '<build directory>/node_modules/fakepkg/package.json' from '/$bunfs/root/app'
Versions
1.4.2
Platforms
macOS
How bad
Breaks a normal workflow.

Not quite your bug?

  1. Plugin onLoad skips CommonJS contents2 people
  2. --preserve-symlinks has no effect1 person

Original reports2, newest first

  1. bun build --compile: a require whose path is computed from __dirname keeps the build machine's absolute path instead of embedding the file#44710
  2. bun build --compile: __dirname/__filename in an included CommonJS entrypoint are inlined as the build directory, not the $bunfs path#44068

Do you work on Bun?

Claim its RAP Sheet to see what your users report and answer them in one place.