Skip to content

gittensory-api Workers Build fails: @jsonbored/gittensory-engine unresolved (dist/ not built before deploy) #4081

Description

@JSONbored

What's broken

The Cloudflare "Workers Builds" auto-deploy for gittensory-api (triggered on every push to main) has failed on every commit since 487d26ac (PR #3986, merged 2026-07-07T09:36:46Z). Confirmed via:

gh api repos/JSONbored/gittensory/commits/<sha>/check-runs \
  --jq '.check_runs[] | select(.name == "Workers Builds: gittensory-api")'

The last successful deploy was 2026-07-07T09:33:24Z (wrangler deployments list --name gittensory-api) — the hosted Worker has been running code from before that point ever since.

Root cause

PR #3986 added src/mcp/find-opportunities.ts, which imports packages/gittensory-miner/lib/opportunity-fanout.js and opportunity-ranker.js (committed, pre-built JS). Both of those import @jsonbored/gittensory-engine, whose dist/ output is gitignored (packages/gittensory-engine/.gitignore) and only exists after an explicit npm run build --workspace @jsonbored/gittensory-engine step.

The Cloudflare Workers Build pipeline for gittensory-api runs npm run deploy:api directly (wrangler d1 migrations apply gittensory --remote && wrangler deploy) with no engine-build step first, so wrangler deploy's esbuild bundler can't resolve the import:

✘ [ERROR] Could not resolve "@jsonbored/gittensory-engine"
    packages/gittensory-miner/lib/opportunity-fanout.js:2:39
    The module "./dist/index.js" was not found on the file system

Reproduced locally: mv packages/gittensory-engine/dist /tmp/... && wrangler deploy --dry-run fails with the exact same error.

This is the same class of bug already fixed three times for other pipelines that gained this same import chain:

gittensory-api's deploy pipeline (npm run deploy:api in package.json, invoked directly by Cloudflare's Workers Builds product rather than a .github/workflows/*.yml file) is the one consumer that never got the equivalent fix.

Fix

Prepend the engine build to deploy:api in package.json, mirroring the other three fixes.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions