{"record":{"id":"8e7b75a2282a6670","repo":"ruvnet/ruflo","slug":"no-transformers-package-available-install-huggin","errorCode":null,"errorMessage":"No transformers package available. Install @huggingface/transformers (preferred) or @xenova/transformers to enable ONNX embeddings.","messagePattern":"No transformers package available\\. Install @huggingface/transformers \\(preferred\\) or @xenova/transformers to enable ONNX embeddings\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/embeddings/src/embedding-service.ts","lineNumber":393,"sourceCode":"  private readonly modelName: string;\n  private initialized = false;\n\n  constructor(config: TransformersEmbeddingConfig) {\n    super(config);\n    this.modelName = config.model ?? 'Xenova/all-MiniLM-L6-v2';\n  }\n\n  private async initialize(): Promise<void> {\n    if (this.initialized) return;\n\n    try {\n      // ADR-094: try @huggingface/transformers first (clears the\n      // protobufjs <7.5.5 critical RCE chain), fall back to legacy\n      // @xenova/transformers for backwards compatibility.\n      const { loadTransformersPipeline } = await import('./transformers-loader.js');\n      const handle = await loadTransformersPipeline();\n      if (!handle) {\n        throw new Error(\n          'No transformers package available. Install @huggingface/transformers (preferred) ' +\n          'or @xenova/transformers to enable ONNX embeddings.',\n        );\n      }\n      this.pipeline = await handle.pipeline('feature-extraction', this.modelName);\n      this.initialized = true;\n    } catch (error) {\n      throw new Error(`Failed to initialize transformers pipeline: ${error}`);\n    }\n  }\n\n  async embed(text: string): Promise<EmbeddingResult> {\n    await this.initialize();\n\n    // Check cache\n    const cached = this.cache.get(text);\n    if (cached) {\n      this.emitEvent({ type: 'cache_hit', text });","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/embeddings/src/embedding-service.ts#L375-L411","documentation":"Thrown when no transformers package is installed for local ONNX embeddings. Defense: check for the dependency at startup and fail fast with the install instruction, or fall back explicitly to another configured provider.","triggerScenarios":"Thrown at v3/@claude-flow/embeddings/src/embedding-service.ts:393 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install a transformers package: npm install @huggingface/transformers (preferred) or @xenova/transformers.","Switch provider to 'agentic-flow' or 'openai' (with apiKey) if you cannot install the ONNX runtime."],"exampleFix":null,"handlingStrategy":"fallback","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-14T05:17:10.506Z"}