anomalyco / anomalyco/opencode
lildax build fails from a fresh clone: Could not resolve "../pkg" (lightningcss)
@kommander is already working on this.
Since Aug 14, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
bun run --cwd packages/cli build --single fails on a fresh clone:
error: Could not resolve: "../pkg"
at node_modules/.bun/lightningcss@1.30.1/node_modules/lightningcss/node/index.js:17:28
lightningcss comes in through @opencode-ai/ui -> tailwind. Its node/index.js has a conditional require("../pkg") for the wasm variant, and Bun.build tries to resolve it even though that branch never runs (the napi package has no pkg dir). Release CI presumably builds under a configuration where this doesn't trigger; a local clone hits it every time.
Marking lightningcss as external in the compile step fixes it. The TUI never calls lightningcss at runtime, so the external is safe; if something ever did call it, the require would fail loudly instead of bundling wrong.
bun 1.3.14.
Plugins
none
OpenCode version
dev branch, 8a55ba75b5
Steps to reproduce
- git clone https://github.com/anomalyco/opencode && cd opencode
- bun install
- bun run --cwd packages/cli build --single
Screenshot and/or share link
No response
Operating System
macOS (Darwin 25.5.0), arm64
Terminal
macos Terminal
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.