Skip to content

opencode fails to build with no matching import error #3773

Closed

Description

@rubin55

When building:

cd "opencode-1.0.12"
bun install
cd packages/tui
CGO_ENABLED=0 go build -ldflags="-s -w -X main.Version=1.0.12" -o tui cmd/opencode/main.go
cd ../opencode
bun build --define OPENCODE_TUI_PATH="'$(realpath ../tui/tui)'" --define OPENCODE_VERSION="'1.0.12'" --compile --target=bun-linux-x64 --outfile=opencode ./src/index.ts

I get this:

error: No matching export in "../../node_modules/.bun/@opentui+solid@0.1.32+1753ef9b65046169/node_modules/@opentui/solid/jsx-runtime.d.ts" for import "jsxDEV"
    at /tmp/makepkg.builddir/opencode/src/opencode-1.0.12/packages/opencode/src/cli/cmd/tui/context/helper.tsx
==> ERROR: A failure occurred in build().

I've read online at various places this could be worked around by setting NODE_ENV=production. However, this only slightly changes the error output (note jsxDEV became jsx):

error: No matching export in "../../node_modules/.bun/@opentui+solid@0.1.32+1753ef9b65046169/node_modules/@opentui/solid/jsx-runtime.d.ts" for import "jsx"
    at /tmp/makepkg.builddir/opencode/src/opencode-1.0.12/packages/opencode/src/cli/cmd/tui/context/helper.tsx
==> ERROR: A failure occurred in build().

OpenCode version

1.0.12

Steps to reproduce

See above

Screenshot and/or share link

N/A

Operating System

Arch Linux

Terminal

Alacritty

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 2, 2025
  2. github-actions commented on Nov 2, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • Packaging Guidance Request for v1.x #3739: This issue discusses the same outdated build process problem for v1.x. The build commands you're using are from the pre-v1.0 architecture when OpenCode used Go+bubbletea TUI, but v1.0+ uses OpenTUI (Zig+SolidJS). The AUR PKGBUILD and manual build instructions need to be updated for the new architecture.

    Feel free to ignore if none of these address your specific case.

  3. rubin55 commented on Nov 3, 2025

    @rubin55
    Author

    If anyone comes across this, github-actions bot is right. The build commands have changed from:

    cd "opencode-1.0.12"
    bun install
    cd packages/tui
    CGO_ENABLED=0 go build -ldflags="-s -w -X main.Version=1.0.12" -o tui cmd/opencode/main.go
    cd ../opencode
    bun build --define OPENCODE_TUI_PATH="'$(realpath ../tui/tui)'" --define OPENCODE_VERSION="'1.0.12'" --compile --target=bun-linux-x64 --outfile=opencode ./src/index.ts

    To:

    cd "opencode-1.0.15"
    bun install
    cd ./packages/opencode
    OPENCODE_CHANNEL=latest OPENCODE_VERSION=1.0.15 bun run ./script/build.ts --single

    (change version accordingly)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions