anomalyco / anomalyco/opencode

lildax build fails from a fresh clone: Could not resolve "../pkg" (lightningcss)

Open
#42,525 1 comment 0 reactions 1 assignee View on GitHub

@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
  1. git clone https://github.com/anomalyco/opencode && cd opencode
  2. bun install
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.