Skip to content

fix(tui): bundle parser worker separately#37571

Closed
opencode-agent[bot] wants to merge 1 commit into
devfrom
opentui-binary-repro
Closed

fix(tui): bundle parser worker separately#37571
opencode-agent[bot] wants to merge 1 commit into
devfrom
opentui-binary-repro

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Summary

  • stop using the OpenTUI parser worker source itself as a Bun build entrypoint
  • compile the same worker through a virtual OpenCode-owned entrypoint instead
  • preserve the explicit cross-platform bunfs worker path without colliding with OpenTUI 0.4.5’s type: "file" import

Fixes #37556.

Testing

  • bun packages/opencode/script/build.ts --single --skip-install --skip-embed-web-ui
  • compiled binary --version smoke passes
  • compiled interactive TUI stays live under a PTY and renders /connect; the prior $.startsWith crash and follow-on worker postMessage failure are absent
  • bun x prettier --check packages/opencode/script/build.ts

Requested by: @rekram1-node (Aiden Cline via Slack)

Avoid registering the OpenTUI parser worker source itself as a build entrypoint. Bun otherwise resolves OpenTUI’s file import as a module namespace without a default path, crashing compiled TUI startup. Bundle an equivalent virtual worker entrypoint so the worker remains executable without colliding with the package asset import.
@opencode-agent

Copy link
Copy Markdown
Contributor Author

Superseded by the requested temporary OpenTUI revert in #37573.

@opencode-agent opencode-agent Bot closed this Jul 18, 2026
@opencode-agent

Copy link
Copy Markdown
Contributor Author

Correction: superseded by #37582.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Compiled binary crashes instantly on TUI launch — undefined is not an object (evaluating '$.startsWith') — since opentui 0.4.5

1 participant