PeterP
Convex Community2y ago
4 replies
Peter

Vector Search ✖ TypeScript typecheck via tsc failed.

Hello everyone, I'm building on the Vector Search feature and I'm encountering an issue like this:
-----------------------------------------
✖ TypeScript typecheck via tsc failed.
To ignore failing typecheck, use --typecheck=disable.
convex/messages.ts:144:34 - error TS2339: Property 'vectorSearch' does not exist on type 'GenericDatabaseReader<{ messages: { document: { _id: Id<"messages">; _creationTime: number; format?: string | undefined; fileId?: Id<"_storage"> | undefined; fileName?: string | undefined; author: string; body: string; }; fieldPaths: "_id" | ExtractFieldPaths<...>; indexes: { ...; }; searchIndexes: {}; vectorIndexes...'.

144 const results = await ctx.db.vectorSearch("vectorDocuments", "by_embedding", {
~~
convex/messages.ts:148:36 - error TS2339: Property 'getMany' does not exist on type 'GenericDatabaseReader<{ messages: { document: { _id: Id<"messages">; _creationTime: number; format?: string | undefined; fileId?: Id<"_storage"> | undefined; fileName?: string | undefined; author: string; body: string; }; fieldPaths: "_id" | ExtractFieldPaths<...>; indexes: { ...; }; searchIndexes: {}; vectorIndexes...'.

148 const documents = await ctx.db.getMany("vectorDocuments", results.map((result: any) => result._id));
~


Found 2 errors in the same file, starting at: convex/messages.ts:144
----------------------------------------------

Looking forward to everyone's help, thank you very much.
image.png
Was this page helpful?