{"record":{"id":"006f25615884c45d","repo":"deepseek-ai/deepseek-harness","slug":"client-modules-client-bundle-not-found-run-pnpm","errorCode":null,"errorMessage":"client-modules: client bundle not found; run `pnpm run build` before launch:\n  package: ${packageName}\n  path: ${clientPath}","messagePattern":"client-modules: client bundle not found; run `pnpm run build` before launch:\n  package: (.+?)\n  path: (.+?)","errorType":"exception","errorClass":"MissingClientBundleError","httpStatus":null,"severity":"error","filePath":"packages/client/modules/src/index.ts","lineNumber":477,"sourceCode":"      immediately: decl.immediately === true,\n    }\n    this.pkgMeta.set(pkgName, meta)\n    return meta\n  }\n\n  /**\n   * Read the activation-time bundle revision.\n   * @param pkgName - package that declares the client bundle.\n   * @param clientPath - absolute path of the built client artifact.\n   * @returns the bundle content's short hash for use as its revision.\n   * @throws {MissingClientBundleError} when the read fails with `ENOENT`; other filesystem errors are rethrown unchanged.\n   */\n  private initialBundleRevision(pkgName: string, clientPath: string): string {\n    try {\n      return shortHash(readFileSync(clientPath))\n    } catch (error) {\n      if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error\n      throw new MissingClientBundleError(pkgName, clientPath, error)\n    }\n  }\n\n  /** Reconcile one entry name against the live loader entries. @returns whether the table changed. */\n  private processOne(entryName: string): boolean {\n    let qualifies = false\n    for (const entry of this.ctx.loader.entries()) {\n      if (entry.options.name === entryName && entry.fiber !== undefined && !entry.disabled) {\n        qualifies = true\n        break\n      }\n    }\n    if (!qualifies) return this.table.delete(entryName)\n    if (this.table.has(entryName)) return false\n    const meta = this.resolveMeta(entryName)\n    if (meta === null) return false\n    // The rev rides the row from here on: a fiber restart reuses the row (and\n    // its rev) untouched; only rebuilt() re-reads the bundle.","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/client/modules/src/index.ts#L459-L495","documentation":"MissingClientBundleError from initialBundleRevision(): when the scan registers a client package, it hashes the built bundle file that exports[\"./client\"] points at; an ENOENT on that read becomes this error (other filesystem errors rethrow unchanged), carrying the package name and the exact missing path. It is retained as structured data so the activation aggregate (index 144) can group every unbuilt package under one build instruction.","triggerScenarios":"A dsh.client package is an active Loader entry with a correct manifest, but the file at its './client' export path (typically lib/client.js) does not exist: launched without building client bundles, `pnpm run clean` removed lib/, or a filtered build skipped that package.","commonSituations":"Editing a plugin's node half and probing a live `dsh web` server without running its `bundle` script — the registry serves lib/client.js, not sources; CI artifact cache missing lib/; clean-then-run workflows.","solutions":["Build the named package's client bundle: `pnpm --filter <packageName> bundle` (or repo-wide `pnpm run build`), then restart — the message prints the exact path to verify.","If the printed path is not the package's real build output, fix exports[\"./client\"] in that package.json to point at the actual bundle.","Put bundle builds into the dev/CI launch script so artifacts exist before the server starts."],"exampleFix":"# before — probe a live server after building only the node half\npnpm --filter @deepseek-ai/dsh-client-ui-workspace build\ndsh web   # client bundle not found; path: .../ui-workspace/lib/client.js\n\n# after — build the bundle the registry serves\npnpm --filter @deepseek-ai/dsh-client-ui-workspace bundle\ndsh web","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs'\n// before launching the web server, verify each client package's bundle is on disk\nconst bundlesReady = (clientPaths: string[]) => clientPaths.every(existsSync)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `pnpm --filter <pkg> bundle` before probing a live dsh web server — the registry serves lib/client.js, not sources.","Keep client bundle builds in the same CI stage that builds node halves.","Never delete or git-ignore lib/ between build and serve."],"tags":["build","enoent","client-bundle","startup"],"backgroundTag":"missing-build-artifact","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}