[GH-ISSUE #5538] User typed as any in both backend and client #18908

Closed
opened 2026-04-15 17:36:28 -05:00 by GiteaMirror · 10 comments
Owner

Originally created by @martinriviere on GitHub (Oct 24, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/5538

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Backend Configuration

// auth.ts
import { betterAuth, InferUser } from 'better-auth';
import { Pool } from 'pg';

const pool = new Pool({
  connectionString: 'postgresql://user:password@localhost:5432/mydb',
});

const createAuthInstance = () => {
  return betterAuth({
    baseURL: 'http://localhost:3000',
    secret: 'my-secret',
    database: pool,
    emailAndPassword: {
      enabled: true,
    },
    hooks:  {
      after: createAuthMiddleware(async ({ context: { newSession } }) => {
        if (!newSession) {
          return;
        }

        const { user } = newSession; // ❌ 'user' is typed as 'any'

        console.log(user.email); // No autocomplete, no type checking
      }),
    },
  });
};

export const auth = createAuthInstance();

// Type exports
export type Auth = ReturnType<typeof createAuthInstance>;
export type AuthUser = InferUser<Auth>; // ❌ Resolves to 'any'

Frontend Configuration (React)

// authClient.ts
import { createAuthClient } from 'better-auth/react';

export const authClient = createAuthClient({
  baseURL: 'http://localhost:3000',
});

export const { useSession, signIn, signOut } = authClient;

Usage in Component

// MyComponent.tsx
import { useSession } from './authClient';

export const MyComponent = () => {
  const { data: session } = useSession();

  if (!session) {
    return <div>Not logged in</div>;
  }

  const { user } = session; // ❌ user is typed as 'any'

  return (
    <div>
      {/* No type error even though 'picture' doesn't exist (should be 'image')! */}
      {user.picture && <img src={user.picture} alt="avatar" />} // ❌ No error

      {/* No autocomplete available for valid properties */}
      <span>{user.email}</span> // ❌ No autocomplete
      <span>{user.name}</span>  // ❌ No autocomplete
    </div>
  );
};

Current vs. Expected behavior

Current Behavior

Both session.user (client) and newSession.user (server) are inferred as any, resulting in:

  • No autocomplete in IDE
  • No type checking
  • Properties like authUser.picture don't show type errors even though they don't exist (should be image)

Also, for any version after 1.3.27, the context.newSession callback argument for createAuthMiddleware is also implicitly typed as any, it's not the case in 1.3.27.

Expected Behavior

The session.user should be typed with Better Auth's default user schema fields:

  • id: string
  • email: string
  • emailVerified: boolean
  • name: string
  • image?: string | null
  • createdAt: Date
  • updatedAt: Date

What version of Better Auth are you using?

1.3.27

System info

{
  "system": {
    "platform": "darwin",
    "arch": "arm64",
    "version": "Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:43 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T8132",
    "release": "24.5.0",
    "cpuCount": 10,
    "cpuModel": "Apple M4",
    "totalMemory": "16.00 GB",
    "freeMemory": "0.12 GB"
  },
  "node": {
    "version": "v22.20.0",
    "env": "development"
  },
  "packageManager": {
    "name": "npm",
    "version": "10.9.3"
  },
  "frameworks": [
    {
      "name": "next",
      "version": "14.2.32"
    },
    {
      "name": "react",
      "version": "18.3.1"
    },
    {
      "name": "express",
      "version": "4.21.2"
    }
  ],
  "databases": [
    {
      "name": "pg",
      "version": "8.16.0"
    },
    {
      "name": "mongodb",
      "version": "5.9.2"
    }
  ],
  "betterAuth": {
    "version": "1.3.27",
    "config": {
      "database": {
        "_events": {},
        "_eventsCount": 1,
        "options": {
          "host": "localhost",
          "port": 5432,
          "user": "XXX",
          "database": "XXX",
          "options": "-c search_path=auth",
          "max": 10,
          "min": 0,
          "maxUses": null,
          "allowExitOnIdle": false,
          "maxLifetimeSeconds": 0,
          "idleTimeoutMillis": 10000
        },
        "_clients": [],
        "_idle": [],
        "_expired": {},
        "_pendingQueue": [],
        "ending": false,
        "ended": false
      }
    }
  }
}

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

Backend, Types, Client

Auth config (if applicable)


Additional context

No response

Originally created by @martinriviere on GitHub (Oct 24, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/5538 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce ### Backend Configuration ```typescript // auth.ts import { betterAuth, InferUser } from 'better-auth'; import { Pool } from 'pg'; const pool = new Pool({ connectionString: 'postgresql://user:password@localhost:5432/mydb', }); const createAuthInstance = () => { return betterAuth({ baseURL: 'http://localhost:3000', secret: 'my-secret', database: pool, emailAndPassword: { enabled: true, }, hooks: { after: createAuthMiddleware(async ({ context: { newSession } }) => { if (!newSession) { return; } const { user } = newSession; // ❌ 'user' is typed as 'any' console.log(user.email); // No autocomplete, no type checking }), }, }); }; export const auth = createAuthInstance(); // Type exports export type Auth = ReturnType<typeof createAuthInstance>; export type AuthUser = InferUser<Auth>; // ❌ Resolves to 'any' ``` ### Frontend Configuration (React) ```typescript // authClient.ts import { createAuthClient } from 'better-auth/react'; export const authClient = createAuthClient({ baseURL: 'http://localhost:3000', }); export const { useSession, signIn, signOut } = authClient; ``` #### Usage in Component ```typescript // MyComponent.tsx import { useSession } from './authClient'; export const MyComponent = () => { const { data: session } = useSession(); if (!session) { return <div>Not logged in</div>; } const { user } = session; // ❌ user is typed as 'any' return ( <div> {/* No type error even though 'picture' doesn't exist (should be 'image')! */} {user.picture && <img src={user.picture} alt="avatar" />} // ❌ No error {/* No autocomplete available for valid properties */} <span>{user.email}</span> // ❌ No autocomplete <span>{user.name}</span> // ❌ No autocomplete </div> ); }; ``` ### Current vs. Expected behavior ## Current Behavior Both `session.user` (client) and `newSession.user` (server) are inferred as `any`, resulting in: - ❌ No autocomplete in IDE - ❌ No type checking - ❌ Properties like `authUser.picture` don't show type errors even though they don't exist (should be `image`) Also, for any version after 1.3.27, the `context.newSession` callback argument for `createAuthMiddleware` is also implicitly typed as `any`, it's not the case in 1.3.27. ## Expected Behavior The `session.user` should be typed with Better Auth's default user schema fields: - `id: string` - `email: string` - `emailVerified: boolean` - `name: string` - `image?: string | null` - `createdAt: Date` - `updatedAt: Date` ### What version of Better Auth are you using? 1.3.27 ### System info ```bash { "system": { "platform": "darwin", "arch": "arm64", "version": "Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:43 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T8132", "release": "24.5.0", "cpuCount": 10, "cpuModel": "Apple M4", "totalMemory": "16.00 GB", "freeMemory": "0.12 GB" }, "node": { "version": "v22.20.0", "env": "development" }, "packageManager": { "name": "npm", "version": "10.9.3" }, "frameworks": [ { "name": "next", "version": "14.2.32" }, { "name": "react", "version": "18.3.1" }, { "name": "express", "version": "4.21.2" } ], "databases": [ { "name": "pg", "version": "8.16.0" }, { "name": "mongodb", "version": "5.9.2" } ], "betterAuth": { "version": "1.3.27", "config": { "database": { "_events": {}, "_eventsCount": 1, "options": { "host": "localhost", "port": 5432, "user": "XXX", "database": "XXX", "options": "-c search_path=auth", "max": 10, "min": 0, "maxUses": null, "allowExitOnIdle": false, "maxLifetimeSeconds": 0, "idleTimeoutMillis": 10000 }, "_clients": [], "_idle": [], "_expired": {}, "_pendingQueue": [], "ending": false, "ended": false } } } } ``` ### Which area(s) are affected? (Select all that apply) Backend, Types, Client ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the locked label 2026-04-15 17:36:28 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 24, 2025):

This is a known limitation in Better Auth v1.3.27: TypeScript infers user types as any because the $Infer helpers only exist at runtime and aren't exposed as static types, breaking the type inference pipeline for both backend and client code. This regression started in v1.3.24 and persists in v1.3.27, so InferUser<Auth> and session.user resolve to any, disabling autocomplete and type checking reference.

Workarounds:

  • Explicitly redeclare your auth config as a const, then use ReturnType<typeof betterAuth<typeof config>> to define your Auth type. For example:

    const config = {
      // ...your config
    } as const;
    
    export type Auth = ReturnType<typeof betterAuth<typeof config>>;
    export const auth: Auth = betterAuth(config);
    
  • On the server, you can use:

    export type AuthSession = Awaited<ReturnType<typeof auth.api.getSession>>;
    

    This gets the session type with proper user typing, but may break with multiple plugins or large configs reference.

  • On the client, use the inferAdditionalFields plugin and pass your server auth type to it:

    import { createAuthClient, inferAdditionalFields } from "better-auth/react";
    import type { Auth } from "../path/to/auth";
    
    export const authClient = createAuthClient({
      plugins: [inferAdditionalFields<Auth>()],
      baseURL: "http://localhost:3000",
    });
    

Extra tips:

  • Make sure "exactOptionalPropertyTypes": false in your tsconfig.json—this flag breaks type inference for plugin fields reference.
  • Avoid force-casting plugins (e.g., as unknown as BetterAuthPlugin), as this suppresses type inference.
  • If you need strict type safety, consider using external schema tools like drizzle-zod as a fallback reference.

Full static type inference for additional fields and plugins is not yet supported in v1.3.27, but recent PRs have improved plugin-aware type inference. For now, these workarounds are the most reliable way to restore type safety and autocomplete for user objects.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

<!-- gh-comment-id:3442248513 --> @dosubot[bot] commented on GitHub (Oct 24, 2025): <!-- Answer --> This is a known limitation in Better Auth v1.3.27: TypeScript infers user types as `any` because the `$Infer` helpers only exist at runtime and aren't exposed as static types, breaking the type inference pipeline for both backend and client code. This regression started in v1.3.24 and persists in v1.3.27, so `InferUser<Auth>` and `session.user` resolve to `any`, disabling autocomplete and type checking [reference](https://github.com/better-auth/better-auth/issues/5462). **Workarounds:** - Explicitly redeclare your auth config as a `const`, then use `ReturnType<typeof betterAuth<typeof config>>` to define your `Auth` type. For example: ```ts const config = { // ...your config } as const; export type Auth = ReturnType<typeof betterAuth<typeof config>>; export const auth: Auth = betterAuth(config); ``` - On the server, you can use: ```ts export type AuthSession = Awaited<ReturnType<typeof auth.api.getSession>>; ``` This gets the session type with proper user typing, but may break with multiple plugins or large configs [reference](https://github.com/better-auth/better-auth/issues/2818). - On the client, use the `inferAdditionalFields` plugin and pass your server auth type to it: ```ts import { createAuthClient, inferAdditionalFields } from "better-auth/react"; import type { Auth } from "../path/to/auth"; export const authClient = createAuthClient({ plugins: [inferAdditionalFields<Auth>()], baseURL: "http://localhost:3000", }); ``` **Extra tips:** - Make sure `"exactOptionalPropertyTypes": false` in your `tsconfig.json`—this flag breaks type inference for plugin fields [reference](https://github.com/better-auth/better-auth/issues/5159). - Avoid force-casting plugins (e.g., `as unknown as BetterAuthPlugin`), as this suppresses type inference. - If you need strict type safety, consider using external schema tools like drizzle-zod as a fallback [reference](https://github.com/better-auth/better-auth/issues/5218). Full static type inference for additional fields and plugins is not yet supported in v1.3.27, but recent PRs have improved plugin-aware type inference. For now, these workarounds are the most reliable way to restore type safety and autocomplete for user objects. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/c402364d-4a2f-490e-b464-d40186138221?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/c402364d-4a2f-490e-b464-d40186138221?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/c402364d-4a2f-490e-b464-d40186138221?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/c402364d-4a2f-490e-b464-d40186138221?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c402364d-4a2f-490e-b464-d40186138221?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/c402364d-4a2f-490e-b464-d40186138221?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c402364d-4a2f-490e-b464-d40186138221?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/5538)
Author
Owner

@R5dan commented on GitHub (Oct 24, 2025):

@martinriviere For the backend, my pr #5208 should fix this. For the front end, I am slightly confused about, as it is cast by the authClient. Can you share the type of useSession.

<!-- gh-comment-id:3442296300 --> @R5dan commented on GitHub (Oct 24, 2025): @martinriviere For the backend, my pr #5208 should fix this. For the front end, I am slightly confused about, as it is cast by the authClient. Can you share the type of `useSession`.
Author
Owner

@martinriviere commented on GitHub (Oct 24, 2025):

@dosu I was able to get a proper AuthUser like this

export type Auth = ReturnType<typeof createBetterAuthInstance>;
export type AuthSession = Awaited<ReturnType<Auth['api']['getSession']>>;
export type AuthUser = NonNullable<AuthSession>['user'];

But the user remains typed as any in the hooks, as well as context.newSession in the createAuthMiddleWare callback argument for version 1.28.0 and 1.29.0.
It also remains typed as any on the client side, even with the inferAdditionalFields usage.
I tried with redeclaring the auth config as const, it didn't change anything...

<!-- gh-comment-id:3442349202 --> @martinriviere commented on GitHub (Oct 24, 2025): @dosu I was able to get a proper `AuthUser` like this ```ts export type Auth = ReturnType<typeof createBetterAuthInstance>; export type AuthSession = Awaited<ReturnType<Auth['api']['getSession']>>; export type AuthUser = NonNullable<AuthSession>['user']; ``` But the `user` remains typed as `any` in the hooks, as well as `context.newSession` in the `createAuthMiddleWare` callback argument for version 1.28.0 and 1.29.0. It also remains typed as `any` on the client side, even with the `inferAdditionalFields` usage. I tried with redeclaring the auth config `as const`, it didn't change anything...
Author
Owner

@martinriviere commented on GitHub (Oct 24, 2025):

@R5dan great, thanks!

useSession has the following type:

const useSession: () => {
    data: {
        user: InferUserFromClient<COpts>;
        session: InferSessionFromClient<COpts>;
    } | null;
    isPending: boolean;
    error: BetterFetchError | null;
    refetch: (queryParams?: {
        query?: SessionQueryParams;
    }) => void;
}
<!-- gh-comment-id:3442364588 --> @martinriviere commented on GitHub (Oct 24, 2025): @R5dan great, thanks! `useSession` has the following type: ```ts const useSession: () => { data: { user: InferUserFromClient<COpts>; session: InferSessionFromClient<COpts>; } | null; isPending: boolean; error: BetterFetchError | null; refetch: (queryParams?: { query?: SessionQueryParams; }) => void; } ```
Author
Owner

@dosubot[bot] commented on GitHub (Oct 24, 2025):

This is a known limitation in Better Auth v1.28.0 and v1.29.0: type inference for user objects in hooks, middleware, and client code often collapses to any, even with recommended patterns like redeclaring your config as const or using inferAdditionalFields. This regression started after v1.3.23 and is due to how type helpers and generics are (not) propagated through the library, especially with plugins and additionalFields—static types are lost, so TypeScript can't infer user fields at compile time, only at runtime [1] [2].

Workarounds like Awaited<ReturnType<Auth['api']['getSession']>>['user'] can give you a correct AuthUser type in isolation, but won't fix the any typing in hooks or middleware callbacks. Even using inferAdditionalFields on the client doesn't always restore type safety if the type pipeline is broken [3].

A few things to check or try:

  • Make sure your tsconfig.json has "exactOptionalPropertyTypes": false—this flag is known to break plugin field inference [4].
  • Avoid force-casting plugins (e.g., as unknown as BetterAuthPlugin), as this suppresses type inference.
  • If you need strict type safety, consider using external schema tools like drizzle-zod to generate types from your DB schema and use those types in your code [5].

There are ongoing PRs to improve this (see #5208 for backend and recent merged PRs for client inference), but as of now, full static type inference for user fields in hooks and middleware is not yet reliable in these versions. If you need a temporary fix, manual type assertions or schema-based types are the most robust workaround until a future release addresses this [6].

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

<!-- gh-comment-id:3442371145 --> @dosubot[bot] commented on GitHub (Oct 24, 2025): <!-- Answer --> This is a known limitation in Better Auth v1.28.0 and v1.29.0: type inference for user objects in hooks, middleware, and client code often collapses to any, even with recommended patterns like redeclaring your config as const or using inferAdditionalFields. This regression started after v1.3.23 and is due to how type helpers and generics are (not) propagated through the library, especially with plugins and additionalFields—static types are lost, so TypeScript can't infer user fields at compile time, only at runtime [[1]](https://github.com/better-auth/better-auth/issues/5462) [[2]](https://github.com/better-auth/better-auth/issues/5291). Workarounds like Awaited<ReturnType<Auth['api']['getSession']>>['user'] can give you a correct AuthUser type in isolation, but won't fix the any typing in hooks or middleware callbacks. Even using inferAdditionalFields on the client doesn't always restore type safety if the type pipeline is broken [[3]](https://github.com/better-auth/better-auth/issues/5218). A few things to check or try: - Make sure your tsconfig.json has "exactOptionalPropertyTypes": false—this flag is known to break plugin field inference [[4]](https://github.com/better-auth/better-auth/issues/5159). - Avoid force-casting plugins (e.g., as unknown as BetterAuthPlugin), as this suppresses type inference. - If you need strict type safety, consider using external schema tools like drizzle-zod to generate types from your DB schema and use those types in your code [[5]](https://github.com/better-auth/better-auth/issues/5218). There are ongoing PRs to improve this (see #5208 for backend and recent merged PRs for client inference), but as of now, full static type inference for user fields in hooks and middleware is not yet reliable in these versions. If you need a temporary fix, manual type assertions or schema-based types are the most robust workaround until a future release addresses this [[6]](https://github.com/better-auth/better-auth/pull/5208). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/11932105-9c5d-4f2e-a464-d44f0a497aa1?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/11932105-9c5d-4f2e-a464-d44f0a497aa1?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/11932105-9c5d-4f2e-a464-d44f0a497aa1?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/11932105-9c5d-4f2e-a464-d44f0a497aa1?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/11932105-9c5d-4f2e-a464-d44f0a497aa1?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/11932105-9c5d-4f2e-a464-d44f0a497aa1?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/11932105-9c5d-4f2e-a464-d44f0a497aa1?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/5538)
Author
Owner

@R5dan commented on GitHub (Oct 24, 2025):

@martinriviere the problem seems to be the client not picking up the getSession default endpoint. The client has an option $InferAuth can you try adding your better auth options there. If that doesn't work (I expect it wont): Are you using any plugins? As they can override the types. If you are not using any plugins, could you try to comment out line 241 of packages/better-auth/src/api/index.ts (its the line that spreads the client plugins).

<!-- gh-comment-id:3442424419 --> @R5dan commented on GitHub (Oct 24, 2025): @martinriviere the problem seems to be the client not picking up the `getSession` default endpoint. The client has an option `$InferAuth` can you try adding your better auth options there. If that doesn't work (I expect it wont): Are you using any plugins? As they can override the types. If you are not using any plugins, could you try to comment out line 241 of `packages/better-auth/src/api/index.ts` (its the line that spreads the client plugins).
Author
Owner

@martinriviere commented on GitHub (Oct 24, 2025):

@R5dan Thanks for the suggestion.
It indeed doesn't work with $InferAuth. I also tried to comment the line that spreads the plugins, but doesn't change anything, the user is still typed as any in the component.
FYI it used to work with a previous version of better-auth some weeks ago, with version 1.3.23 for instance.

<!-- gh-comment-id:3443230685 --> @martinriviere commented on GitHub (Oct 24, 2025): @R5dan Thanks for the suggestion. It indeed doesn't work with `$InferAuth`. I also tried to comment the line that spreads the plugins, but doesn't change anything, the `user` is still typed as `any` in the component. FYI it used to work with a previous version of `better-auth` some weeks ago, with version `1.3.23` for instance.
Author
Owner

@Bekacru commented on GitHub (Oct 24, 2025):

can you update to latest and let me know if this is still an issue? also if it's please share me your tsconfig

<!-- gh-comment-id:3443515025 --> @Bekacru commented on GitHub (Oct 24, 2025): can you update to latest and let me know if this is still an issue? also if it's please share me your tsconfig
Author
Owner

@R5dan commented on GitHub (Oct 24, 2025):

@martinriviere ok Im not entirely sure why this isn't working now. The problem seems to be with the return type of the router function and the InferSessionAPI type helper.

<!-- gh-comment-id:3443708778 --> @R5dan commented on GitHub (Oct 24, 2025): @martinriviere ok Im not entirely sure why this isn't working now. The problem seems to be with the return type of the `router` function and the `InferSessionAPI` type helper.
Author
Owner

@martinriviere commented on GitHub (Oct 24, 2025):

@Bekacru @R5dan Everything works as expected now on both backend and clients, with the 1.3.30 👌

Looking at the diff with the 1.3.29 and https://github.com/better-auth/better-auth/pull/5427 I realized this was due to my moduleResolution, set to node (= node10).
So 1.3.30 fixes that, and I could confirm the cause by changing it to nodenext with previous versions, and it also worked!

Thanks a lot for your help 🙏

<!-- gh-comment-id:3445214943 --> @martinriviere commented on GitHub (Oct 24, 2025): @Bekacru @R5dan Everything works as expected now on both backend and clients, with the 1.3.30 👌 Looking at the diff with the 1.3.29 and https://github.com/better-auth/better-auth/pull/5427 I realized this was due to my `moduleResolution`, set to `node` (= `node10`). So 1.3.30 fixes that, and I could confirm the cause by changing it to `nodenext` with previous versions, and it also worked! Thanks a lot for your help 🙏
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#18908