opencode fails to build with no matching import error #2499

Closed
opened 2026-02-16 17:35:57 -05:00 by yindo · 2 comments
Owner

Originally created by @rubin55 on GitHub (Nov 2, 2025).

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

Originally created by @rubin55 on GitHub (Nov 2, 2025). 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
yindo added the opentuibug labels 2026-02-16 17:35:57 -05:00
yindo closed this issue 2026-02-16 17:35:57 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 2, 2025):

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

  • #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.

@github-actions[bot] commented on GitHub (Nov 2, 2025): This issue might be a duplicate of existing issues. Please check: - #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.
Author
Owner

@rubin55 commented on GitHub (Nov 3, 2025):

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)

@rubin55 commented on GitHub (Nov 3, 2025): If anyone comes across this, github-actions bot is right. The build commands have changed from: ```shell 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: ```shell 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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2499