{"record":{"id":"121d93e5e168da61","repo":"chroma-core/chroma","slug":"sparse-embedding-function-with-name-name-is-alr","errorCode":null,"errorMessage":"Sparse embedding function with name ${name} is already registered.","messagePattern":"Sparse embedding function with name (.+?) is already registered\\.","errorType":"validation","errorClass":"ChromaValueError","httpStatus":null,"severity":"error","filePath":"clients/new-js/packages/chromadb/src/embedding-function.ts","lineNumber":216,"sourceCode":"    throw new ChromaValueError(\n      `Embedding function with name ${name} is already registered.`,\n    );\n  }\n  knownEmbeddingFunctions.set(name, fn);\n};\n\n/**\n * Registers a sparse embedding function in the global registry.\n * @param name - Unique name for the sparse embedding function\n * @param fn - Sparse embedding function class to register\n * @throws ChromaValueError if name is already registered\n */\nexport const registerSparseEmbeddingFunction = (\n  name: string,\n  fn: SparseEmbeddingFunctionClass,\n) => {\n  if (knownSparseEmbeddingFunctions.has(name)) {\n    throw new ChromaValueError(\n      `Sparse embedding function with name ${name} is already registered.`,\n    );\n  }\n  knownSparseEmbeddingFunctions.set(name, fn);\n};\n\n/**\n * Retrieves and instantiates an embedding function from configuration.\n * @returns EmbeddingFunction instance or undefined if it cannot be constructed\n */\nexport const getEmbeddingFunction = async (args: {\n  client: ChromaClient;\n  efConfig?: EmbeddingFunctionConfiguration;\n}) => {\n  const { client, efConfig } = args;\n\n  if (efConfig?.type !== \"known\") {\n    return undefined;","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/new-js/packages/chromadb/src/embedding-function.ts#L198-L234","documentation":"Error \"Sparse embedding function with name ${name} is already registered.\" thrown in chroma-core/chroma.","triggerScenarios":"Thrown at clients/new-js/packages/chromadb/src/embedding-function.ts:216 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}