[GH-ISSUE #1113] toSolidStartHandler type mismatch #8601

Closed
opened 2026-04-13 03:43:04 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @nhjjgjjg on GitHub (Jan 3, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1113

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Install the Package
  2. Set Environment Variables
  3. Create A Better Auth Instance
  4. Configure Database
  5. Create Database Tables
  6. Authentication Methods
  7. Mount Handler

Current vs. Expected behavior

Argument of type '{ handler: (request: Request) => Promise; api: InferAPI<{ ok: { <C extends [(better_call.Context<"/ok", { method: "GET"; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { ok: { type: string; }; }; ...' is not assignable to parameter of type 'Auth | ((request: Request) => Promise)'.
Type '{ handler: (request: Request) => Promise; api: InferAPI<{ ok: { <C extends [(better_call.Context<"/ok", { method: "GET"; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { ok: { type: string; }; }; ...' is not assignable to type 'Auth'.
The types of 'api.getSession' are incompatible between these types.
Type '(context: { headers: Headers; query?: { disableCookieCache?: boolean | undefined; } | undefined; asResponse?: R | undefined; }) => false extends R ? Promise<...> & { ...; } : Promise<...>' is missing the following properties from type '{ <C_1 extends [better_call.Context<"/get-session", { method: "GET"; query: zod.ZodOptional<zod.ZodObject<{ disableCookieCache: zod.ZodOptional<zod.ZodUnion<[zod.ZodBoolean, zod.ZodEffects<zod.ZodString, boolean, string>]>>; disableRefresh: zod.ZodOptional<zod.ZodBoolean>; }, "strip", zod.ZodTypeAny, { disableCookie...': path, options, method, headersts(2345)

What version of Better Auth are you using?

1.18

Provide environment information

- OS: Windows 11

Which area(s) are affected? (Select all that apply)

Types

Auth config (if applicable)

import { auth } from "~/lib/auth";
import { toSolidStartHandler } from "better-auth/solid-start";
 
export const { GET, POST } = toSolidStartHandler(auth);

Additional context

No response

Originally created by @nhjjgjjg on GitHub (Jan 3, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1113 ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce 1. Install the Package 2. Set Environment Variables 3. Create A Better Auth Instance 4. Configure Database 5. Create Database Tables 6. Authentication Methods 7. Mount Handler ### Current vs. Expected behavior Argument of type '{ handler: (request: Request) => Promise<Response>; api: InferAPI<{ ok: { <C extends [(better_call.Context<"/ok", { method: "GET"; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { ok: { type: string; }; }; ...' is not assignable to parameter of type 'Auth | ((request: Request) => Promise<Response>)'. Type '{ handler: (request: Request) => Promise<Response>; api: InferAPI<{ ok: { <C extends [(better_call.Context<"/ok", { method: "GET"; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { ok: { type: string; }; }; ...' is not assignable to type 'Auth'. The types of 'api.getSession' are incompatible between these types. Type '<R extends boolean>(context: { headers: Headers; query?: { disableCookieCache?: boolean | undefined; } | undefined; asResponse?: R | undefined; }) => false extends R ? Promise<...> & { ...; } : Promise<...>' is missing the following properties from type '{ <C_1 extends [better_call.Context<"/get-session", { method: "GET"; query: zod.ZodOptional<zod.ZodObject<{ disableCookieCache: zod.ZodOptional<zod.ZodUnion<[zod.ZodBoolean, zod.ZodEffects<zod.ZodString, boolean, string>]>>; disableRefresh: zod.ZodOptional<zod.ZodBoolean>; }, "strip", zod.ZodTypeAny, { disableCookie...': path, options, method, headersts(2345) ### What version of Better Auth are you using? 1.18 ### Provide environment information ```bash - OS: Windows 11 ``` ### Which area(s) are affected? (Select all that apply) Types ### Auth config (if applicable) ```typescript import { auth } from "~/lib/auth"; import { toSolidStartHandler } from "better-auth/solid-start"; export const { GET, POST } = toSolidStartHandler(auth); ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-13 03:43:04 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8601