npm run build fails with 12 TS errors and emits no dist/, but the published build script wraps every stage in || true
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 812
- Forks
- 175
- Avg merge
- 2m
- Merged PRs (30d)
- 3
Description
Summary
npm run build fails in a clean clone with 12 TypeScript errors and produces no dist/. The published package's build script differs from the repo's and wraps every stage in || true, so those errors are swallowed and a partial dist/ is shipped. This looks like the common cause behind a set of runtime symptoms reported separately (#182).
Reproduction
git clone --depth 1 https://github.com/ruvnet/agentic-flow.git && cd agentic-flow
npm install # ok — 1246 packages
npm run build # exit 2, no dist/ produced
Errors fall into four groups:
src/harness/metaharness.ts(10-13): error TS2614: Module '"ruvector"' has no exported member
'runMetaHarnessDarwin' / 'runMetaHarnessFlywheel' /
'scanMetaHarnessRewardHacks' / 'verifyMetaHarnessReplay'
src/reasoningbank/utils/embeddings.ts(6,31): error TS2307: Cannot find module '@huggingface/transformers'
src/services/embedding-service.ts(205,41): error TS2307: Cannot find module '@huggingface/transformers'
src/utils/model-cache.ts(216,41): error TS2307: Cannot find module '@huggingface/transformers'
src/router/cost-optimal-router.ts(18,64): error TS2307: Cannot find module '@metaharness/router'
src/router/router.ts(410-411): error TS2339: Property 'id' / 'predictedQuality' /
'costPerMTok' / 'metBar' does not exist on type 'CostOptimalDecision'
@huggingface/transformers and @metaharness/router are imported but not declared as dependencies.
The build-script divergence
repo package.json: "build": "npm run build:main && npm run build:packages"
published package.json: "build": "(npm run build:wasm || true) && (tsc -p config/tsconfig.json --skipLibCheck || true) && …"
The published variant cannot fail: every stage is || true and tsc runs with --skipLibCheck. So the artifact on npm is whatever partial output survived a compile that errored.
Consistent runtime symptoms
These are what a partial dist/ would produce, and all are observable in the published 2.1.0:
MoEAttention is not a constructorandAdamOptimizer is not a constructoron everyhooks intelligenceinvocation — even though@ruvector/attentionexports both correctly (typeof MoEAttention === 'function'verified directly), so this is a resolution failure inside agentic-flow, not a broken native binding../core,./coordinationand./mcpare absent from the packageexportsmap, so documented imports fail withERR_PACKAGE_PATH_NOT_EXPORTEDwhile the classes exist atdist/core/…anddist/coordination/….import { AgenticFlow } from 'agentic-flow'— the main entry exports onlymainandreasoningbank.- The three missing
@huggingface/transformersimports are all on the embedding path, which may relate to hash-embedding fallbacks appearing where real embeddings are expected.
The quality gates cannot catch it
npm run lint → Cannot read config file: config/.eslintrc.strict.js (file absent)
npm run typecheck → same TS2307/TS2614 family (checks agentic-flow/src, a second copy of the tree)
npm run test:coverage → ReferenceError: module is not defined in ES module scope
(config/jest.config.js uses module.exports under "type": "module";
the sibling config/jest.config.cjs is fine)
npm run quality:check → dies at step 1 (lint), and would die again at test:coverage
npm run bench:attention → Cannot find module '../agentic-flow/dist/core/agentdb-wrapper-enhanced.js'
(from benchmarks/ that resolves to <repo>/agentic-flow/dist/, not <repo>/dist/)
npm run test:attention → 12 tests, 12 failures, including
"should perform 4x faster than standard attention",
"should improve recall by >10%", "should route to sparse experts"
npm test → passes while printing "✅ Spawned 0/5 agents",
"✅ Completed 0/5 tasks", "✅ Coordinated 0/6 connections"
Two things worth separating out:
npm testtreats 0/5 as success. A benchmark suite that spawns zero of five agents and prints a checkmark cannot detect the dispatch failure in #182.- There appear to be two copies of the source tree —
src/andagentic-flow/src/— with the same errors at different line numbers, so they have diverged.buildcompiles one,typecheckchecks the other. Several scripts (test:main,typecheck) assume the nested layout whilebuildandbenchassume the flat one.
Suggested fix
- Drop
|| truefrom the published build script so a failed compile cannot publish. - Declare
@huggingface/transformersand@metaharness/router, or remove the imports. - Add the missing
config/.eslintrc.strict.js, and pointtest:coverageatjest.config.cjs. - Reconcile
src/andagentic-flow/src/, and make the script paths agree on one layout.
Environment: node v22.23.0, npm 10.9.8, darwin arm64, repo HEAD d3735a3 (version 2.0.2-alpha), published 2.1.0.
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start by comparing the build entries in package.json with the published package metadata, then run npm run build and inspect config/tsconfig.json, src/, and agentic-flow/src/. Check the listed missing modules, type errors, package exports, and quality-gate scripts. Done means a clean clone builds a complete dist/ without swallowed errors and the relevant checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- build-system, release, tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100