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, 8a55ba7
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
Description
bun run --cwd packages/cli build --singlefails on a fresh clone: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, 8a55ba7
Steps to reproduce
Screenshot and/or share link
No response
Operating System
macOS (Darwin 25.5.0), arm64
Terminal
macos Terminal