Michal Srb
Michal Srb9mo ago

I'd:

I'd: - Make sure that npx convex dev is running successfully (it does a little codegen that might have different results between your branches) - Restart TypeScript server in VS Code (as it is a fickle mistress)
5 Replies
Foxxy
Foxxy9mo ago
TS server restart brings the same errors back, and I can't get the dev command to run successfully because all of the convex errors
Michal Srb
Michal SrbOP9mo ago
What errors are you getting on the CLI from convex dev?
Foxxy
Foxxy9mo ago
Looks to be two types of issues... first, something with the query syntax is breaking. any query that uses a composite index is throwing an error on the second .eq().
convex/world.ts:342:66 - error TS2339: Property 'eq' does not exist on type 'IndexRange'.

342 .withIndex('worldId', (q) => q.eq('worldId', args.worldId).eq('id', args.conversationId))
convex/world.ts:342:66 - error TS2339: Property 'eq' does not exist on type 'IndexRange'.

342 .withIndex('worldId', (q) => q.eq('worldId', args.worldId).eq('id', args.conversationId))
Second, I'm getting type errors on returned values. Something seems to not want to be converting from the internal types back to the "nice" values
convex/world.ts:113:39 - error TS2345: Argument of type 'Value' is not assignable to parameter of type 'Id<string>'.

113 const engine = await ctx.db.get(worldStatus.engineId);
convex/world.ts:113:39 - error TS2345: Argument of type 'Value' is not assignable to parameter of type 'Id<string>'.

113 const engine = await ctx.db.get(worldStatus.engineId);
It's just strange that it thinks that .eq() is returning an IndexRange, and not the NextIndexRangeBuilder. I'm just not as familiar to really drill into why
lee
lee9mo ago
did something happen with your schema.ts file? both of these errors indicate the schema.ts has problems. you could try a npx convex codegen which may work to generate code without typechecking.
Michal Srb
Michal SrbOP9mo ago
(or npx convex dev --typecheck=disable)

Did you find this page helpful?