Skip to content

opencode crashes at startup on FreeBSD: Cannot find module '@ff-labs/fff-bun' #48658

Closed as not planned

Description

@Mawfyy

Description

Building/running opencode from source on FreeBSD crashes at startup. bun install itself succeeds (Bun skips platform-mismatched optional deps), but @ff-labs/fff-bun declares "os": ["darwin", "linux", "win32"], so on FreeBSD Bun resolves it in the lockfile but never extracts it to node_modules. The static import in packages/core/src/filesystem/fff.bun.ts then throws and the CLI dies before doing anything.

OpenCode version

dev (1.18.30)

Steps to reproduce

  1. On FreeBSD, install Bun and clone the repo
  2. bun install (succeeds, but @ff-labs/fff-bun is not extracted)
  3. bun run --cwd packages/opencode ./src/index.ts --version
  4. Crashes: error: Cannot find module '@ff-labs/fff-bun'

Operating System

FreeBSD 14.x (x64)

Activity

  1. asomers commented on Oct 20, 2026

    @asomers

    I cannot reproduce with OpenCode v2.0.32 on FreeBSD 15.1 .

  2. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report and the root-cause analysis!

    You're building packages/opencode at version 1.18.30, which is OpenCode v1. v1 now only gets fixes for critical bugs (data loss, security problems, or breakage with no workaround on supported platforms), so this is unlikely to be fixed there. We recommend moving to v2 (2.x, the @opencode/cli package). On the current dev branch the CLI is in packages/cli, so from source you'd run something like bun install && bun run --cwd packages/cli ./src/index.ts --version.

    v2 may behave the same way: packages/core/src/filesystem/fff.bun.ts on dev still imports @ff-labs/fff-bun statically, and that package only targets darwin/linux/win32. If you can try v2 on FreeBSD and it also crashes with Cannot find module '@ff-labs/fff-bun', please reply here with the v2 version and the full output, and we'll look at it as a v2 issue. Also reply if you think this is critical for v1.

  3. opencodejr commented on Oct 29, 2026

    @opencodejr
    Contributor

    Closing this as not planned. The crash was reported on a v1 build (1.18.30, packages/opencode), and v1 only gets critical fixes. We haven't heard whether it also happens on v2.

    If you try v2 on FreeBSD (packages/cli on dev) and it also fails with Cannot find module '@ff-labs/fff-bun', please open a new issue or comment here with the v2 version and the full output, and we'll take another look. Thanks again for the clear write-up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions