{"record":{"id":"c518daceb85c9b81","repo":"deepseek-ai/deepseek-harness","slug":"client-modules-client-modules-id-client-js-did","errorCode":null,"errorMessage":"client-modules: ${CLIENT_MODULES_ID}/client.js did not export the bootstrap module face","messagePattern":"client-modules: (.+?)/client\\.js did not export the bootstrap module face","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"packages/client/modules/src/index.ts","lineNumber":259,"sourceCode":"export function bootInjections(graph: WebBootGraph): IndexInjection[] {\n  const bootstrapId = JSON.stringify(CLIENT_MODULES_ID)\n  const queue = `(()=>{\nconst pendingQueue=[]\nwindow.__ModuleLoader__={\n  mode:\"queue\",\n  pendingQueue,\n  load(registration){pendingQueue.push(registration)},\n  create(options){\n    if(this.mode!==\"queue\")throw new Error(\"client-modules: window.__ModuleLoader__.create called after module-system boot\")\n    const index=pendingQueue.findIndex(registration=>registration.id===${bootstrapId})\n    const registration=pendingQueue[index]\n    if(registration===undefined)throw new Error(\"client-modules: HTML did not preload ${CLIENT_MODULES_ID}/client.js\")\n    pendingQueue.splice(index,1)\n    const exports=registration.factory(specifier=>{\n      throw new Error('client-modules: ${CLIENT_MODULES_ID}/client.js requested external \"'+specifier+'\" before the module system existed')\n    })\n    if(typeof exports!==\"object\"||exports===null||typeof exports.createClientModuleSystem!==\"function\"||typeof exports.apply!==\"function\"){\n      throw new Error(\"client-modules: ${CLIENT_MODULES_ID}/client.js did not export the bootstrap module face\")\n    }\n    return exports.createClientModuleSystem(this,{id:registration.id,exports},options)\n  }\n}\n})()`\n  const preload = PARSER_PRELOAD_IDS.map(id => graph.entries.find(entry => entry.id === id))\n    .filter((entry): entry is WebBootEntry => entry !== undefined)\n    .map((entry): IndexInjection => ({ kind: 'script-src', placement: 'head', src: entry.url }))\n  return [\n    { kind: 'script', placement: 'head', text: queue },\n    ...preload,\n    { kind: 'global', name: '__DSH_BOOT__', value: graph },\n  ]\n}\n\n/**\n * The web plugin table service: incremental `dsh.client` scan + wire composition\n * + bundle route + index injection rows. Construction runs the activation scan","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/client/modules/src/index.ts#L241-L277","documentation":"After the preloaded bootstrap bundle's factory runs, its exports must be an object exposing both createClientModuleSystem and apply functions — the bootstrap module face the HTML queue protocol depends on. This error means the script that registered under id '@deepseek-ai/dsh-client-modules' executed and returned something else: a wrong, stale, or foreign artifact is being served at the preload URL, or the bundle was built against a different protocol version.","triggerScenarios":"The bytes served at /plugins/@deepseek-ai/dsh-client-modules/client.js?rev=... are not the current bootstrap bundle: a stale static copy or partially rebuilt tree, a proxy or service worker rewriting the path, or the package's exports[\"./client\"] manifest edited to point at a different file. The factory returns exports lacking createClientModuleSystem or apply.","commonSituations":"Partial `pnpm run build` leaving one package's client bundle from an older protocol generation; hand-copying an old dist into a static directory next to the server; browser cache pinning an old bundle; mixed versions after switching branches without rebuilding.","solutions":["Run a full `pnpm run build` so HTML protocol and bundles come from the same build, then hard-reload.","Fetch the preload URL and check the response is JavaScript and contains 'createClientModuleSystem'; if not, find what actually serves that path (static dir, proxy, service worker) and remove it.","Check @deepseek-ai/dsh-client-modules package.json exports[\"./client\"] still maps to the real bundle output (lib/client.js).","Unregister service workers and clear cache in dev; keep the ?rev= cache-buster intact so stale bundles cannot survive a graph change."],"exampleFix":"# before — stale artifact pinned by a copied static dir\ncp -r old-dist/client.js static/plugins/@deepseek-ai/dsh-client-modules/\n\n# after — the registry's own /plugins route serves the bundle it composed\ncurl 'http://localhost:3000/plugins/@deepseek-ai/dsh-client-modules/client.js?rev=<graph-rev>' | grep -c createClientModuleSystem\n# expect: 1","handlingStrategy":"validation","validationCode":"// pre-flight before boot: the served bootstrap bundle must carry the module face\nconst res = await fetch(`/plugins/@deepseek-ai/dsh-client-modules/client.js?rev=${rev}`)\nconst text = await res.text()\nif (!res.ok || !text.includes('createClientModuleSystem')) {\n  throw new Error('bootstrap bundle missing the module face — rebuild and hard-reload')\n}","typeGuard":null,"tryCatchPattern":"try {\n  system = window.__ModuleLoader__.create(options)\n} catch (error) {\n  reportBootFailure(error) // advise full rebuild + cache clear; do not retry against the same bytes\n  throw error\n}","preventionTips":["Produce HTML and all client bundles from one `pnpm run build`; the protocol evolves atomically.","Never hand-copy bundles into static directories next to the server.","Keep the ?rev= cache-buster intact and unregister service workers in dev."],"tags":["browser","boot","module-loader","version-mismatch"],"backgroundTag":"stale-build-artifact","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}