Skip to content

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

Description

@moedash

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

  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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions