[GH-ISSUE #4328] authClient is not working on Tanstack latest version (1.131.30) #9899

Closed
opened 2026-04-13 05:42:44 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @diecodev on GitHub (Aug 31, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/4328

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  • Create a default tanstack start project.
  • Do not change the default config (it means, do not use SPA mode)
  • add better auth following general installation steps and tanstack steps
  • try to use authClient at component level - client side - (since loader and beforeLoad run in server, you need to use auth.api.* in that functions.
  • go to the browser tab and open the app.
  • navigate to the route where you use authClient at component level

Current vs. Expected behavior

  • if you visit the page, it should works, showing the session data (null | { session: {}, user: {} }, instead, the app crash entirely showing an error realted to tanstack-start-create-server-fn plugin, but the fun fact is: if you remove the authClient usage from the component, it's going to work .-.

Demo code:

import { useNavigate } from '@tanstack/react-router';
import { Loader } from 'lucide-react';
import { useState } from 'react';
import { signIn } from '~/utils/auth-client';
import { cn } from '~/utils/cn';

export function Login() {
  const [isPending, setIsPending] = useState<boolean>(false);
  const navigate = useNavigate();

  const signInHandler = async () => {
    await signIn.social(
      { provider: 'github' },
      {
        onSuccess: () => {
          navigate({ to: '/' });
        },
        onError: () => {
          setIsPending(false);
        },
      }
    );
  };

  return (
    <div className="flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
      <button className="w-full gap-2" onClick={signInHandler} type="button">
        <svg
          className={cn(
            'transition-opacity duration-200',
            isPending ? 'opacity-50' : 'opacity-100'
          )}
          height="1em"
          role="graphics-symbol img"
          viewBox="0 0 24 24"
          width="1em"
          xmlns="http://www.w3.org/2000/svg"
        >
          <path
            d="M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2"
            fill="currentColor"
          />
        </svg>
        <span
          className={cn(
            'transition-opacity duration-200',
            isPending ? 'opacity-70' : 'opacity-100'
          )}
        >
          Sign in with Github
        </span>
        {isPending && <Loader className="size-4 animate-spin" />}
      </button>
    </div>
  );
}

Output

https://github.com/user-attachments/assets/142759a6-f24c-4d81-a8e4-0835e07ab1da

What version of Better Auth are you using?

1.3.6

System info

System:
    OS: macOS 15.6.1
    CPU: (12) arm64 Apple M4 Pro
    Memory: 97.20 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Brave Browser: 139.1.81.137
    Chrome: 139.0.7258.155
    Safari: 18.6

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

Client

Auth config (if applicable)

import { betterAuth } from 'better-auth';
import { drizzleAdapter } from 'better-auth/adapters/drizzle';
import { organization } from 'better-auth/plugins';
import { reactStartCookies } from 'better-auth/react-start';
import { db } from './auth.db';
import * as schema from './auth.schema';
import { parsedEnv } from './env-parser';

const isDev = new URL(parsedEnv.BETTER_AUTH_URL).hostname === 'localhost';

export const auth = betterAuth({
  appName: 'tanstack_proof',
  database: drizzleAdapter(db, { provider: 'sqlite', schema }),
  session: {
    cookieCache: { enabled: true, maxAge: 5 * 60 },
  },
  plugins: [
    organization(),
    reactStartCookies(),
  ],
  trustedOrigins: [parsedEnv.BETTER_AUTH_URL],
  secret: parsedEnv.BETTER_AUTH_SECRET,
  baseURL: parsedEnv.BETTER_AUTH_URL,
  socialProviders: {
    github: {
      clientId: parsedEnv.GITHUB_CLIENT_ID,
      clientSecret: parsedEnv.GITHUB_CLIENT_SECRET,
    },
  },
  advanced: { cookiePrefix: parsedEnv.COOKIE_PREFIX },
});

Additional context

  • I use latest version and the error is still happening.
  • I know the error say [plugin:vite-plugin-tanstack-start-create-server-fn] but the error is only happening when I use authClient at component level.
  • I did not try with authClient.getSession() function, but it's weird that useSession is not working too.
  • Also, the auth.api.* cannot be called directly inside of loader or beforeLoad. To use it, you need to use createServerFn helper.

Demo usage of auth.api:

const sessionServerFn = createServerFn({ method: 'GET' }).handler(async () => {
  const headers = getHeaders() as unknown as Headers;

  return await auth.api.getSession({
    headers,
  });
});

export const Route = createFileRoute('/')({
  component: () => (
    <div className="flex min-h-svh min-w-svw items-center justify-center">
      <Loader2 className="animate-spin" />
    </div>
  ),
  loader: async () => {
    const session = await sessionServerFn();

    if (!session?.session) {
      throw redirect({ to: '/login' });
    }
  },
});
Originally created by @diecodev on GitHub (Aug 31, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/4328 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce - Create a default tanstack start project. - Do not change the default config (it means, do not use SPA mode) - add better auth following [general installation steps](https://www.better-auth.com/docs/installation) and [tanstack steps](https://www.better-auth.com/docs/integrations/tanstack) - try to use `authClient` at component level - client side - (since `loader` and `beforeLoad` run in server, you need to use `auth.api.*` in that functions. - go to the browser tab and open the app. - navigate to the route where you use `authClient` at component level ### Current vs. Expected behavior - if you visit the page, it should works, showing the session data (`null | { session: {}, user: {} }`, instead, the app crash entirely showing an error realted to `tanstack-start-create-server-fn` plugin, but the fun fact is: if you remove the authClient usage from the component, it's going to work .-. ### Demo code: ```tsx import { useNavigate } from '@tanstack/react-router'; import { Loader } from 'lucide-react'; import { useState } from 'react'; import { signIn } from '~/utils/auth-client'; import { cn } from '~/utils/cn'; export function Login() { const [isPending, setIsPending] = useState<boolean>(false); const navigate = useNavigate(); const signInHandler = async () => { await signIn.social( { provider: 'github' }, { onSuccess: () => { navigate({ to: '/' }); }, onError: () => { setIsPending(false); }, } ); }; return ( <div className="flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10"> <button className="w-full gap-2" onClick={signInHandler} type="button"> <svg className={cn( 'transition-opacity duration-200', isPending ? 'opacity-50' : 'opacity-100' )} height="1em" role="graphics-symbol img" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg" > <path d="M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2" fill="currentColor" /> </svg> <span className={cn( 'transition-opacity duration-200', isPending ? 'opacity-70' : 'opacity-100' )} > Sign in with Github </span> {isPending && <Loader className="size-4 animate-spin" />} </button> </div> ); } ``` ### Output https://github.com/user-attachments/assets/142759a6-f24c-4d81-a8e4-0835e07ab1da ### What version of Better Auth are you using? 1.3.6 ### System info ```bash System: OS: macOS 15.6.1 CPU: (12) arm64 Apple M4 Pro Memory: 97.20 MB / 24.00 GB Shell: 5.9 - /bin/zsh Browsers: Brave Browser: 139.1.81.137 Chrome: 139.0.7258.155 Safari: 18.6 ``` ### Which area(s) are affected? (Select all that apply) Client ### Auth config (if applicable) ```typescript import { betterAuth } from 'better-auth'; import { drizzleAdapter } from 'better-auth/adapters/drizzle'; import { organization } from 'better-auth/plugins'; import { reactStartCookies } from 'better-auth/react-start'; import { db } from './auth.db'; import * as schema from './auth.schema'; import { parsedEnv } from './env-parser'; const isDev = new URL(parsedEnv.BETTER_AUTH_URL).hostname === 'localhost'; export const auth = betterAuth({ appName: 'tanstack_proof', database: drizzleAdapter(db, { provider: 'sqlite', schema }), session: { cookieCache: { enabled: true, maxAge: 5 * 60 }, }, plugins: [ organization(), reactStartCookies(), ], trustedOrigins: [parsedEnv.BETTER_AUTH_URL], secret: parsedEnv.BETTER_AUTH_SECRET, baseURL: parsedEnv.BETTER_AUTH_URL, socialProviders: { github: { clientId: parsedEnv.GITHUB_CLIENT_ID, clientSecret: parsedEnv.GITHUB_CLIENT_SECRET, }, }, advanced: { cookiePrefix: parsedEnv.COOKIE_PREFIX }, }); ``` ### Additional context - I use latest version and the error is still happening. - I know the error say `[plugin:vite-plugin-tanstack-start-create-server-fn]` but the error is only happening when I use `authClient` at component level. - I did not try with `authClient.getSession()` function, but it's weird that `useSession` is not working too. - Also, the `auth.api.*` cannot be called directly inside of `loader` or `beforeLoad`. To use it, you need to use `createServerFn` helper. ### Demo usage of `auth.api`: ```tsx const sessionServerFn = createServerFn({ method: 'GET' }).handler(async () => { const headers = getHeaders() as unknown as Headers; return await auth.api.getSession({ headers, }); }); export const Route = createFileRoute('/')({ component: () => ( <div className="flex min-h-svh min-w-svw items-center justify-center"> <Loader2 className="animate-spin" /> </div> ), loader: async () => { const session = await sessionServerFn(); if (!session?.session) { throw redirect({ to: '/login' }); } }, }); ```
GiteaMirror added the locked label 2026-04-13 05:42:44 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 31, 2025):

Hi @diecodev! I'm Dosu and I’m helping the better-auth team.

This issue is likely caused by a server/client boundary problem: some server-only code or dependencies (like Node.js modules) may be leaking into your client bundle when you use authClient at the component level. This can happen if your client-side code (or its imports) references files or modules that are only meant for the server, which triggers errors related to plugins like tanstack-start-create-server-fn or missing modules such as fs or tls in the browser environment. This pattern has been reported by others using Better Auth with Tanstack and Next.js as well [source].

To avoid this, make sure that your authClient setup and any code it imports do not reference server-only modules, adapters, or configuration. Double-check that your authClient is created in a file that only imports client-safe code, and that your server-side auth instance (with adapters, DB, etc.) is never imported into the client bundle. Also, ensure your baseURL is set correctly in both server and client configs, as missing or mismatched URLs can cause hydration and session issues in Tanstack Start [source].

If you’re still seeing errors, try isolating your authClient setup in a dedicated client-only file, and confirm that your imports do not pull in anything from your server-side auth config. This should prevent server-only code from leaking into your client bundle and resolve the crash.

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:3239857020 --> @dosubot[bot] commented on GitHub (Aug 31, 2025): <!-- Greeting --> Hi @diecodev! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> This issue is likely caused by a server/client boundary problem: some server-only code or dependencies (like Node.js modules) may be leaking into your client bundle when you use `authClient` at the component level. This can happen if your client-side code (or its imports) references files or modules that are only meant for the server, which triggers errors related to plugins like `tanstack-start-create-server-fn` or missing modules such as `fs` or `tls` in the browser environment. This pattern has been reported by others using Better Auth with Tanstack and Next.js as well [[source]](https://github.com/better-auth/better-auth/issues/3136#issuecomment-2994839239). To avoid this, make sure that your `authClient` setup and any code it imports do not reference server-only modules, adapters, or configuration. Double-check that your `authClient` is created in a file that only imports client-safe code, and that your server-side `auth` instance (with adapters, DB, etc.) is never imported into the client bundle. Also, ensure your `baseURL` is set correctly in both server and client configs, as missing or mismatched URLs can cause hydration and session issues in Tanstack Start [[source]](https://github.com/better-auth/better-auth/discussions/2889). If you’re still seeing errors, try isolating your `authClient` setup in a dedicated client-only file, and confirm that your imports do not pull in anything from your server-side auth config. This should prevent server-only code from leaking into your client bundle and resolve the crash. <!-- 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/b06189e1-574c-40f9-a7a0-9a4d89b14f40?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/b06189e1-574c-40f9-a7a0-9a4d89b14f40?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/b06189e1-574c-40f9-a7a0-9a4d89b14f40?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/b06189e1-574c-40f9-a7a0-9a4d89b14f40?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b06189e1-574c-40f9-a7a0-9a4d89b14f40?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/b06189e1-574c-40f9-a7a0-9a4d89b14f40?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b06189e1-574c-40f9-a7a0-9a4d89b14f40?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/4328)
Author
Owner

@diecodev commented on GitHub (Aug 31, 2025):

@dosu What you mentioned looks solid in general, but it doesn’t apply here. My authClient setup is:

import { organizationClient } from 'better-auth/client/plugins';
import { createAuthClient } from 'better-auth/react';

export const authClient = createAuthClient({
  basePath: 'auth',
  plugins: [organizationClient()],
});

export type Session = typeof authClient.$Infer.Session;

This code only uses client-side packages (better-auth/react and better-auth/client/plugins). It doesn’t import my server-side auth instance, DB adapters, or any Node-only modules. I also tried swapping better-auth/reactbetter-auth/client, but the error persists.

I’m running the default TanStack Start template, where loader and beforeLoad run on the server, and components are rendered on the server then hydrated on the client (classic SSR). Given that, authClient should be safe to use at the component level, yet the crash still happens.

This looks more like an incompatibility between authClient hydration and tanstack-start-create-server-fn, rather than a server/client boundary issue in my code.

<!-- gh-comment-id:3239903055 --> @diecodev commented on GitHub (Aug 31, 2025): @dosu What you mentioned looks solid in general, but it doesn’t apply here. My `authClient` setup is: ```tsx import { organizationClient } from 'better-auth/client/plugins'; import { createAuthClient } from 'better-auth/react'; export const authClient = createAuthClient({ basePath: 'auth', plugins: [organizationClient()], }); export type Session = typeof authClient.$Infer.Session; ``` This code only uses client-side packages (`better-auth/react` and `better-auth/client/plugins`). It doesn’t import my server-side `auth` instance, DB adapters, or any Node-only modules. I also tried swapping `better-auth/react` → `better-auth/client`, but the error persists. I’m running the default TanStack Start template, where `loader` and `beforeLoad` run on the server, and components are rendered on the server then hydrated on the client (classic SSR). Given that, `authClient` should be safe to use at the component level, yet the crash still happens. This looks more like an incompatibility between `authClient` hydration and `tanstack-start-create-server-fn`, rather than a server/client boundary issue in my code.
Author
Owner

@dosubot[bot] commented on GitHub (Aug 31, 2025):

Your setup is correct and client-only, but there’s evidence that using authClient (especially hooks like useSession) at the component level in TanStack Start SSR can trigger hydration errors or plugin crashes, even when no server code leaks into the client bundle. This is likely due to how TanStack Start handles SSR and hydration, where client hooks may run on the server and cause state mismatches or plugin conflicts—especially with the tanstack-start-create-server-fn plugin [source].

A few things to check or try:

  • Make sure you set the baseUrl in your createAuthClient config. Missing or mismatched baseUrl can cause session fetching to fail during SSR and trigger hydration errors [source].
  • If you use useSession, ensure it doesn’t run on the server or that its initial state is always isPending: true during SSR to avoid hydration mismatches [source].
  • If possible, try the Provider pattern: populate initial session data server-side and inject it into your client via a context/provider, so client hooks don’t need to fetch or hydrate session state on mount.

If you can share the exact error message or stack trace from the crash, I can help pinpoint whether it’s a hydration mismatch, plugin boundary, or something else.

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:3239905465 --> @dosubot[bot] commented on GitHub (Aug 31, 2025): <!-- Answer --> Your setup is correct and client-only, but there’s evidence that using `authClient` (especially hooks like `useSession`) at the component level in TanStack Start SSR can trigger hydration errors or plugin crashes, even when no server code leaks into the client bundle. This is likely due to how TanStack Start handles SSR and hydration, where client hooks may run on the server and cause state mismatches or plugin conflicts—especially with the `tanstack-start-create-server-fn` plugin [[source]](https://github.com/better-auth/better-auth/issues/4328). A few things to check or try: - Make sure you set the `baseUrl` in your `createAuthClient` config. Missing or mismatched `baseUrl` can cause session fetching to fail during SSR and trigger hydration errors [[source]](https://github.com/better-auth/better-auth/discussions/2889). - If you use `useSession`, ensure it doesn’t run on the server or that its initial state is always `isPending: true` during SSR to avoid hydration mismatches [[source]](https://github.com/better-auth/better-auth/issues/2462#issuecomment-2834000847). - If possible, try the Provider pattern: populate initial session data server-side and inject it into your client via a context/provider, so client hooks don’t need to fetch or hydrate session state on mount. If you can share the exact error message or stack trace from the crash, I can help pinpoint whether it’s a hydration mismatch, plugin boundary, or something else. <!-- 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/1ad42acb-c1b0-4f33-929c-42ec0c1e9975?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/1ad42acb-c1b0-4f33-929c-42ec0c1e9975?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/1ad42acb-c1b0-4f33-929c-42ec0c1e9975?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/1ad42acb-c1b0-4f33-929c-42ec0c1e9975?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1ad42acb-c1b0-4f33-929c-42ec0c1e9975?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/1ad42acb-c1b0-4f33-929c-42ec0c1e9975?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1ad42acb-c1b0-4f33-929c-42ec0c1e9975?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/4328)
Author
Owner

@dannylin108 commented on GitHub (Sep 3, 2025):

I'm using authClient.getSession() or authClient.<myPluginName>.signIn(...) in client code with TanStack Start without issues. It seems you messed up with your setup:

  const signInHandler = async () => {
    await signIn.social( // <<--- should be authClient.signIn.social(
      { provider: 'github' },
      {
        onSuccess: () => {
          navigate({ to: '/' });
        },
        onError: () => {
          setIsPending(false);
        },
      }
    );
  };

make a reproducible repo with your issue

<!-- gh-comment-id:3249427840 --> @dannylin108 commented on GitHub (Sep 3, 2025): I'm using `authClient.getSession()` or `authClient.<myPluginName>.signIn(...)` in client code with TanStack Start without issues. It seems you messed up with your setup: ``` const signInHandler = async () => { await signIn.social( // <<--- should be authClient.signIn.social( { provider: 'github' }, { onSuccess: () => { navigate({ to: '/' }); }, onError: () => { setIsPending(false); }, } ); }; ``` make a reproducible repo with your issue
Author
Owner

@diecodev commented on GitHub (Sep 3, 2025):

@dannylin108 see the video, in there I'm using authClient instead of signInt method, and the error still occurs. here is a repo example: https://github.com/diecodev/better-auth-tanstack

also, I do not think is something related to my config, since I just migrate to nextjs and everything works as expected

<!-- gh-comment-id:3251023336 --> @diecodev commented on GitHub (Sep 3, 2025): @dannylin108 see the video, in there I'm using authClient instead of signInt method, and the error still occurs. here is a repo example: https://github.com/diecodev/better-auth-tanstack also, I do not think is something related to my config, since I just migrate to nextjs and everything works as expected
Author
Owner

@dannylin108 commented on GitHub (Sep 4, 2025):

here is a repo example: https://github.com/diecodev/better-auth-tanstack

You didn't setup better-auth's auth.ts properly. There's no file named auth.ts in src/ or src/utils/

<!-- gh-comment-id:3251169765 --> @dannylin108 commented on GitHub (Sep 4, 2025): > here is a repo example: https://github.com/diecodev/better-auth-tanstack You didn't setup better-auth's `auth.ts` properly. There's no file named `auth.ts` in `src/` or `src/utils/`
Author
Owner

@diecodev commented on GitHub (Sep 4, 2025):

https://github.com/user-attachments/assets/f9565503-3977-43ff-9d93-bfef336a4ef0

@dannylin108 even if I replace auth.server.ts -> auth.ts is not working

<!-- gh-comment-id:3251190389 --> @diecodev commented on GitHub (Sep 4, 2025): https://github.com/user-attachments/assets/f9565503-3977-43ff-9d93-bfef336a4ef0 @dannylin108 even if I replace `auth.server.ts` -> `auth.ts` is not working
Author
Owner

@diecodev commented on GitHub (Sep 4, 2025):

@dannylin108 this issue is fixed on latest beta version of better auth, ty sm for your help!

<!-- gh-comment-id:3251225233 --> @diecodev commented on GitHub (Sep 4, 2025): @dannylin108 this issue is fixed on latest beta version of better auth, ty sm 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#9899