get-convex / get-convex/better-auth
Type error after following documentation
- Dominant language
- TypeScript
- Stars
- 764
- Forks
- 126
- PR merge metrics
- No merged PRs in 30d
Description
I started a migration from a project to Convex and since I started using Better-Auth and is now possible with Convex, I went all-in. But after following the steps in the documentation, I still had a type error which wouldn't go away, even after thinking I had to `bun dev` beforehand.
The code:
The error (on line 35):
```text
Argument of type 'GenericQueryCtx<{ barbershops: { document: { _id: Id<"barbershops">; _creationTime: number; description?: string | undefined; coordinates?: { x: number; y: number; } | undefined; contactPhone?: string | undefined; ... 13 more ...; state: string; }; fieldPaths: ExtractFieldPaths<...> | "_id"; indexes: { ...; }; searc...' is not assignable to parameter of type 'GenericCtx<{ barbershops: { document: { _id: Id<"barbershops">; _creationTime: number; description?: string | undefined; coordinates?: { x: number; y: number; } | undefined; contactPhone?: string | undefined; ... 13 more ...; state: string; }; fieldPaths: ExtractFieldPaths<...> | "_id"; indexes: { ...; }; searchInde...'.
Type 'GenericQueryCtx<{ barbershops: { document: { _id: Id<"barbershops">; _creationTime: number; description?: string | undefined; coordinates?: { x: number; y: number; } | undefined; contactPhone?: string | undefined; ... 13 more ...; state: string; }; fieldPaths: ExtractFieldPaths<...> | "_id"; indexes: { ...; }; searc...' is missing the following properties from type 'GenericMutationCtx<{ barbershops: { document: { _id: Id<"barbershops">; _creationTime: number; description?: string | undefined; coordinates?: { x: number; y: number; } | undefined; contactPhone?: string | undefined; ... 13 more ...; state: string; }; fieldPaths: ExtractFieldPaths<...> | "_id"; indexes: { ...; }; se...': scheduler, runMutationts(2345)
```
Repo: https://github.com/pulgueta/panabarbero/blob/convex/apps/convex/convex/auth.ts
Contributor guide
Research direction
Start with convex/apps/convex/convex/auth.ts in the linked repository and compare its usage with the Better Auth and Convex documentation steps. Reproduce the type error on line 35, then determine whether the documented example and the repository code agree; done means the documented setup compiles without the reported GenericQueryCtx and GenericMutationCtx mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100