q.contains & Array Indexing Type Error (
q.contains & Array Indexing Type Error (Convex 1.25.2) Hello Convex Team,
I'm facing a persistent TypeScript type error with q.contains and array indexing (readBy._value) that's preventing deployment.
Errors:
Property 'contains' does not exist on type 'FilterBuilder...' in messages.ts (line 276).
Type '"readBy._value"' is not assignable... in schema.ts (line 72).
Context:
convex@^1.25.2
Node.js v18.20.5
Trying to filter messages by readBy: v.array(v.id('users')) using q.contains and by_readBy_element index (['readBy._value']).
Troubleshooting Done:
Extensive cleanups performed: rm -rf node_modules, package-lock.json, convex/_generated, npm install, npx convex deploy, TS server restart. Errors persist during Convex's server-side typecheck.
Temporary Workaround:
Currently using client-side JS filtering in messages.ts and have commented out the problematic index in schema.ts to unblock deployment.
Files for Review:
package.json
convex/schema.ts
convex/messages.ts
Any help diagnosing this would be greatly appreciated!
1 Reply
This error is correct,
Property 'contains' does not exist on type 'FilterBuilder...' in messages.ts (line 276).There is no q.contains(). Please open a thread in #support-community