Skip to content

Standalone binary from build.ts --single produces black screen + freeze #18451

@jerome-benoit

Description

@jerome-benoit

Description

The standalone binary produced by bun --bun ./script/build.ts --single --skip-install is broken on current dev. bun run dev works correctly.

This is release-blocking. script/build.ts --single is used by publish.ts to produce binaries for all distribution channels: npm, Homebrew, AUR, Docker, and Nix.

Bisect result

The service/adapter split in d70099b05 introduces circular dependencies that break the bundled binary. PR #18438 attempts to fix the cycles but only turns the crash into a silent freeze.

Error at d70099b05

TypeError: undefined is not an object (evaluating 'Snapshot2.FileDiff.array')
      at <anonymous> (/$bunfs/root/src/index.js:121277:34)
      at <anonymous> (/$bunfs/root/src/index.js:121752:5)

Steps to reproduce

cd packages/opencode
bun --bun ./script/build.ts --single --skip-install
./dist/opencode-*/bin/opencode

OpenCode version

dev @ 129fe1e3

Operating System

macOS 26.3.1 (aarch64), Linux x86_64

Terminal

Alacritty 0.16.1, Ghostty

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions