{"record":{"id":"069afb1f66dcc12c","repo":"deepseek-ai/deepseek-harness","slug":"client-modules-duplicate-factory-registration-for","errorCode":null,"errorMessage":"client-modules: duplicate factory registration for \"${registration.id}\" (bundle executed twice without invalidate?)","messagePattern":"client-modules: duplicate factory registration for \"(.+?)\" \\(bundle executed twice without invalidate\\?\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/client/modules/src/client/system.ts","lineNumber":107,"sourceCode":"    })\n\n    const target = options.registrationTarget\n    if (target.mode !== 'queue') {\n      throw new Error('client-modules: window.__ModuleLoader__.create called after module-system boot')\n    }\n    const pending = target.pendingQueue.splice(0)\n    // Switch first: a bundle that executes while pending registrations drain\n    // must register live rather than append behind the drain.\n    target.mode = 'live'\n    target.load = (registration) => { this.register(registration) }\n    for (const registration of pending) target.load(registration)\n  }\n\n  /** Register one bundle factory, rejecting a script that executes twice without invalidation. */\n  private register(registration: ClientBundleRegistration): void {\n    const id = stripClientSuffix(registration.id)\n    if (this.bootstrapIds.has(id) || this.factories.has(id)) {\n      throw new Error(`client-modules: duplicate factory registration for \"${registration.id}\" (bundle executed twice without invalidate?)`)\n    }\n    this.factories.set(id, registration.factory)\n  }\n\n  /** Load one graph row so its factory is registered (idempotent per in-flight arrival). */\n  private arrive(row: BootModuleRow): Promise<void> {\n    const { id, url } = row\n    const pending = this.pendingArrival.get(id)\n    if (pending !== undefined) return pending\n    if (this.loadCache.has(id) || this.factories.has(id)) return Promise.resolve()\n    const task = this.loadBundle(url).then(() => {\n      if (!this.factories.has(id)) {\n        throw new Error(`client-modules: bundle ${url} loaded without registering \"${id}\" via __ModuleLoader__.load`)\n      }\n    }).finally(() => { this.pendingArrival.delete(id) })\n    this.pendingArrival.set(id, task)\n    return task\n  }","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/client/modules/src/client/system.ts#L89-L125","documentation":"Error \"client-modules: duplicate factory registration for \"${registration.id}\" (bundle executed twice without invalidate?)\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/client/modules/src/client/system.ts:107 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Invalidate the module before re-executing its bundle; avoid executing the bundle twice."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}