punnP
Convex Community3y ago
9 replies
punn

Type API does not satisfy the constraint GenericAPI

I'm facing this error while running convex dev

Found 8 errors in the same file, starting at: convex/_generated/server.d.ts:49

TypeScript typecheck via `tsc` failed.
To ignore failing typecheck, use `--typecheck=disable`.
Preparing Convex functions...
convex/_generated/server.d.ts:49:47 - error TS2344: Type 'API' does not satisfy the constraint 'GenericAPI'.
  Types of property 'publicQueries' are incompatible.
    Type '{ readonly "users:getUser": () => { _id: Id<"users">; _creationTime: number; number?: string | undefined; email?: string | undefined; stripeCustomerId?: string | undefined; name: string; hasEmail: boolean; hasNumber: boolean; tokenIdentifier: string; finishedProfileSetup: boolean; } | null; ... 20 more ...; "integra...' is not assignable to type 'Record<string, ConvexFunction>'.
      Property '"integrationsStore/dist/hostaway:storeRawReservations"' is incompatible with index signature.
        Type '(...args: [] | [args: any]) => any' is not assignable to type 'ConvexFunction'.
          Types of parameters 'args' and 'args' are incompatible.
            Type '[args?: any]' is not assignable to type '[] | [args: any]'.
              Type '[args?: any]' is not assignable to type '[args: any]'.
                Source provides no match for required element at position 0 in target.


Those functions mentioned in the error message was working as intended until I added more actions and mutations. My suspicion is the :any typing but not sure why this is the case. I need to use :any as I'm working with large response objects from an external API call.
Was this page helpful?