{"record":{"id":"a68e91e1fff7f65f","repo":"mem0ai/mem0","slug":"failed-to-delete-collection-error-instanceof-er","errorCode":null,"errorMessage":"Failed to delete collection: ${error instanceof Error ? error.message : String(error)}","messagePattern":"Failed to delete collection: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/vector_stores/vectorize.ts","lineNumber":214,"sourceCode":"        ids: [vectorId],\n      });\n    } catch (error) {\n      console.error(\"Error deleting vector:\", error);\n      throw new Error(\n        `Failed to delete vector: ${error instanceof Error ? error.message : String(error)}`,\n      );\n    }\n  }\n\n  async deleteCol(): Promise<void> {\n    await this.initialize();\n    try {\n      await this.client?.vectorize.indexes.delete(this.indexName, {\n        account_id: this.accountId,\n      });\n    } catch (error) {\n      console.error(\"Error deleting collection:\", error);\n      throw new Error(\n        `Failed to delete collection: ${error instanceof Error ? error.message : String(error)}`,\n      );\n    }\n  }\n\n  async list(\n    filters?: SearchFilters,\n    topK: number = 20,\n  ): Promise<[VectorStoreResult[], number]> {\n    await this.initialize();\n    try {\n      const result = await this.client?.vectorize.indexes.query(\n        this.indexName,\n        {\n          account_id: this.accountId,\n          vector: Array(this.dimensions).fill(0), // Dummy vector for listing\n          filter: filters,\n          topK: topK,","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/vectorize.ts#L196-L232","documentation":"Error \"Failed to delete collection: ${error instanceof Error ? error.message : String(error)}\" thrown in mem0ai/mem0.","triggerScenarios":"Thrown at mem0-ts/src/oss/src/vector_stores/vectorize.ts:214 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the Vectorize index name and credentials are correct.","Verify the index exists in your Cloudflare Vectorize dashboard before deleting.","Retry with exponential backoff for transient network errors."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}