Skip to content

fix(opencode): force single React version in oclite build (#139) - #140

Merged
randomm merged 4 commits into
devfrom
fix/issue-139-react-version
Feb 5, 2026
Merged

randomm merged 4 commits into
devfrom
fix/issue-139-react-version

Conversation

@randomm

@randomm randomm commented Feb 5, 2026

Copy link
Copy Markdown
Owner

Fixes #139

Summary

Adds Bun build plugin to force all React imports to use Ink's React 19.2.4, preventing multiple React versions in the oclite bundle.

Problem

  • Workspace has React 18.3.1
  • Ink bundles React 19.2.4
  • Both versions ended up in final bundle
  • React hooks failed due to multiple React instances

Solution

Build plugin redirects:

  • react → Ink's React 19 (node_modules/ink/node_modules/react/index.js)
  • react/jsx-runtime → Ink's JSX runtime

Verification

✅ Build succeeds: bun run build:lite
✅ TUI renders properly (header + input visible)
✅ Bundle contains only React 19 imports

…139)

- Upgrade React from 18.3.1 to ^19.0.0 to match Ink's React 19 dependency
- Remove ink-text-input dependency and implement custom input handling with useInput hook
- Create lightweight LiteApp component for simplified TUI
- Simplify entry point by removing Instance.provide overhead
- Add TTY check to prevent non-interactive terminal errors

Fixes #139
@github-actions

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@randomm
randomm merged commit f837a85 into dev Feb 5, 2026
2 checks passed
@randomm
randomm deleted the fix/issue-139-react-version branch February 5, 2026 09:31
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.

1 participant