VectorIndex not on v module
Hey, just started using convex: it's great!
One issue I'm having is that I don't see the .vectorIndex method existing on defineTable({...}). I only see .index and .searchIndex.
Is there something separate I must do?
36 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Can we see how you define your schema, because I just tested it locally, and I have searchIndex,index,validator,and vectorIndex
No validator or vector index; just index and searchIndex
Hm... I don't have a "Table" constructor
import { Table } from "convex-helpers/server";
Hmm no luck so far
import { defineSchema} from "convex/server";
export default defineSchema({
documents: defineTable({
...
}).vectorIndex,
});
^using the latest convex if that helps
Thats wierd...
import { defineSchema } from "convex/server";
remove the defineTable
hmm
my mistake 🙂
oh no no thank you
still not saying found strange
what you see, i dont see, so you must show me the code, and tell me thats strange 😄
thats not enough
and your schema?
in separate files but
import { defineSchema } from "convex/server";
import { DocumentsSchemaMetadataTable, DocumentsTable } from "./DocumentSchema";
// Define the full schema with tables.
export default defineSchema({
documents: DocumentsTable,
documentsSchemaMetadata: DocumentsSchemaMetadataTable,
});
thats strange 😄
what typescript version are you using?
lemme see
"typescript": "^5.6.2"
"@types/node": "^22.7.1",
"@types/react": "^17.0.0",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
im not sure if its related to that,,, im running 5.1.6
hmm let me try
"convex": "^1.16.0",
"convex-helpers": "^0.1.57",
"convex": "^1.16.3",
"convex-helpers": "^0.1.58",
ok not typescript
try to downgrade your convex
just to test
ok
didnt work, still views defineSchema as in convex/schema
what is packages?
is that your project folder?
"dependencies": {
"convex": "1.16.0",
"convex-helpers": "^0.1.58",
"next": "^12.0.0",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"ts-node": "^10.9.2",
"uuid": "^10.0.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/node": "^22.7.1",
"@types/react": "^17.0.0",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"eslint": "^8.0.0",
"eslint-config-next": "^12.0.0",
"jest": "^29.6.4",
"lerna": "^7.4.2",
"ts-jest": "^29.1.1",
"typescript": "^5.6.2"
}
how did you create the project?
React Quickstart | Convex Developer Hub
Add Convex to a React project
{
"functions": "./packages/convex"
}
then the normal deploy
you need to pick from these quickstarts
which one did oyu use?
Next.js Quickstart | Convex Developer Hub
Add Convex to a Next.js project
this is the one i used
try new proejct from start
npx create-next-app@latest my-app
cd my-app && npm install convex
weird.. its working when i do that..
hmm
somehow fixed it. not sure what did it exactly, but i tried the installation pipeline again with npm instead of yarn now it works, maybe it was a build file?
I could be many things, but I dont know what it could be 🙂