{"record":{"id":"2a1fd8473a551235","repo":"deepseek-ai/deepseek-harness","slug":"client-modules-string-failures-length-client","errorCode":null,"errorMessage":"client-modules: ${String(failures.length)} client ${packageNoun} failed to compose:","messagePattern":"client-modules: (.+?) client (.+?) failed to compose:","errorType":"exception","errorClass":"ClientPackageCompositionError","httpStatus":null,"severity":"critical","filePath":"packages/client/modules/src/index.ts","lineNumber":336,"sourceCode":"      if (entryName === undefined) return\n      this.dirty.add(entryName)\n      if (this.flushQueued) return\n      this.flushQueued = true\n      queueMicrotask(() => {\n        this.flushQueued = false\n        this.flush((err) => { ctx.logger.warn(err) })\n      })\n    })\n\n    // Activation pass: the initial scan IS the incremental path over the\n    // current entries, flushed synchronously (nothing async between subscribe,\n    // seed, and flush).\n    for (const entry of ctx.loader.entries()) this.dirty.add(entry.options.name)\n    this.composed = this.compose()\n    const failures: Error[] = []\n    this.flush(err => failures.push(err))\n    if (failures.length > 0) {\n      throw new ClientPackageCompositionError(failures)\n    }\n\n    ctx.effect(\n      () => ctx.webServer.register({ kind: 'prefix', path: '/plugins', handler: this.serveBundle }),\n      'client-modules: bundle route',\n    )\n    ctx.on('webserver/index-inject', (table) => {\n      table.push(...bootInjections(this.composed))\n    })\n  }\n\n  /**\n   * Current composed entry graph (stable object between changes).\n   * @returns the graph served as `window.__DSH_BOOT__`.\n   */\n  graph(): WebBootGraph {\n    return this.composed\n  }","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/client/modules/src/index.ts#L318-L354","documentation":"AggregateError thrown from the ClientModuleRegistry constructor's activation flush. The constructor scans all current Loader entries for packages declaring dsh.client; every per-package failure (missing built bundle, malformed declaration, unorderable module graph) is collected and rethrown as one ClientPackageCompositionError. Its message groups missing client bundles under the `pnpm run build` instruction and lists every other failure; the fiber lands FAILED at boot and the boot activation audit reports it.","triggerScenarios":"Starting the web profile when one or more dsh.client packages' built artifacts are absent (fresh clone without a client build), a package.json carries a malformed dsh.client declaration (non-string platform, non-array inject/external), or the composed set contains a module-graph cycle or self-request that orderByModuleGraph rejects during the same flush.","commonSituations":"Fresh clone plus `pnpm install` but no `pnpm run build`; a new client plugin package that fails the checklist (no ./client export, wrong dsh.client fields); dsh.client.external cycles between two packages; CI cache restoring sources without lib/ artifacts.","solutions":["Run `pnpm run build` and restart — the message itself instructs this, and unbuilt client bundles are the most common cause.","For entries under 'other failures', fix each named package: validate its dsh.client fields (platform string, inject/external string arrays, immediately boolean) and its exports[\"./client\"] entry.","For a module graph cycle, break the synchronous request cycle in dsh.client.external — a requested package row must precede its consumers and factory-form CJS cannot deliver partial exports.","Re-run and read the grouped message: every failing package and path is enumerated; fix them all in one pass instead of iterating boot-by-boot."],"exampleFix":"# before — fresh clone, node-only tooling\npnpm install && pnpm dsh --profile web-app web\n# client-modules: 3 client packages failed to compose: client bundles not found; run `pnpm run build`\n\n# after\npnpm run build && pnpm dsh --profile web-app web","handlingStrategy":"try-catch","validationCode":"import { existsSync } from 'node:fs'\n// pre-boot: every dsh.client package's declared bundle must be on disk\nfor (const [name, clientPath] of declaredClientPaths()) {\n  if (!existsSync(clientPath)) throw new Error(`${name}: ${clientPath} missing — run pnpm run build`)\n}","typeGuard":null,"tryCatchPattern":"try {\n  await bootWebProfile()\n} catch (error) {\n  if (error instanceof AggregateError) {\n    for (const inner of error.errors) {\n      // missing-bundle entries carry package + path: build; others: fix the named declaration\n      console.error(inner.message)\n    }\n  }\n  throw error\n}","preventionTips":["Make `pnpm run build` a standing pre-launch step in dev and CI, not just `pnpm install`.","Validate new plugin packages with verify-client-packages before adding them to a profile.","Keep CI artifact caches in sync with sources so lib/ never goes missing."],"tags":["startup","aggregate-error","build","client-bundle"],"backgroundTag":"plugin-activation-failed","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}