{"record":{"id":"a24a405b6581fb7c","repo":"ruvnet/ruflo","slug":"transformers-js-embedding-failed-message","errorCode":null,"errorMessage":"Transformers.js embedding failed: ${message}","messagePattern":"Transformers\\.js embedding failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/embeddings/src/embedding-service.ts","lineNumber":439,"sourceCode":"\n    try {\n      const output = await this.pipeline(text, { pooling: 'mean', normalize: true });\n      const embedding = new Float32Array(output.data);\n\n      // Cache result\n      this.cache.set(text, embedding);\n\n      const latencyMs = performance.now() - startTime;\n      this.emitEvent({ type: 'embed_complete', text, latencyMs });\n\n      return {\n        embedding,\n        latencyMs,\n      };\n    } catch (error) {\n      const message = error instanceof Error ? error.message : 'Unknown error';\n      this.emitEvent({ type: 'embed_error', text, error: message });\n      throw new Error(`Transformers.js embedding failed: ${message}`);\n    }\n  }\n\n  async embedBatch(texts: string[]): Promise<BatchEmbeddingResult> {\n    await this.initialize();\n\n    this.emitEvent({ type: 'batch_start', count: texts.length });\n    const startTime = performance.now();\n\n    const embeddings: Float32Array[] = [];\n    let cacheHits = 0;\n\n    for (const text of texts) {\n      const cached = this.cache.get(text);\n      if (cached) {\n        embeddings.push(cached);\n        cacheHits++;\n        this.emitEvent({ type: 'cache_hit', text });","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/embeddings/src/embedding-service.ts#L421-L457","documentation":"Thrown from TransformersEmbeddingService.embed when the ONNX pipeline call fails for a given text; the per-text error surfaces after an embed_error event, and other texts may still embed successfully.","triggerScenarios":"Thrown at v3/@claude-flow/embeddings/src/embedding-service.ts:439 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped message; reduce input length if the model rejects oversized inputs.","Ensure the pipeline finished initializing before calling embed; await initialization.","Retry with a smaller batch to rule out memory pressure in the ONNX runtime."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}