Docs recommend getCookieCache(), which is not compatible with NextJS edge environment #2082

Closed
opened 2026-03-13 09:25:28 -05:00 by GiteaMirror · 11 comments
Owner

Originally created by @michidk on GitHub (Oct 6, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Implement the middleware mentioned here using getSessionCookie() or getCookieCache(): https://www.better-auth.com/docs/integrations/next#middleware
import { NextRequest, NextResponse } from "next/server";
import { getSessionCookie } from "better-auth/cookies";

export async function middleware(request: NextRequest) {
	const sessionCookie = getSessionCookie(request);

    // THIS IS NOT SECURE!
    // This is the recommended approach to optimistically redirect users
    // We recommend handling auth checks in each page/route
	if (!sessionCookie) {
		return NextResponse.redirect(new URL("/", request.url));
	}

	return NextResponse.next();
}

export const config = {
	matcher: ["/dashboard"], // Specify the routes the middleware applies to
};

or

import { getCookieCache } from "better-auth/cookies";

export async function middleware(request: NextRequest) {
	const session = await getCookieCache(request);
	if (!session) {
		return NextResponse.redirect(new URL("/sign-in", request.url));
	}
	return NextResponse.next();
}
  1. Build the project
$ next build
   ▲ Next.js 15.3.3
   
Environments: .env.local

   Creating an optimized production build ...
 ⚠ Compiled with warnings in 1000ms

./node_modules/better-auth/dist/shared/better-auth.DgGir396.mjs
A Node.js API is used (process.platform at line: 74) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime

Import trace for requested module:
./node_modules/better-auth/dist/shared/better-auth.DgGir396.mjs
./node_modules/better-auth/dist/cookies/index.mjs

 ✓ Compiled successfully in 55s

Current vs. Expected behavior

NextJS builds without warnings and the middleware works

What version of Better Auth are you using?

1.3.24

System info

{
  "system": {
    "platform": "linux",
    "arch": "x64",
    "version": "#1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025",
    "release": "6.6.87.2-microsoft-standard-WSL2",
    "cpuCount": 16,
    "cpuModel": "12th Gen Intel(R) Core(TM) i5-12500H",
    "totalMemory": "15.46 GB",
    "freeMemory": "9.07 GB"
  },
  "node": {
    "version": "v22.15.0",
    "env": "development"
  },
  "packageManager": {
    "name": "bun",
    "version": "1.2.13"
  },
  "frameworks": [
    {
      "name": "next",
      "version": "15.3.3"
    },
    {
      "name": "react",
      "version": "19.1.0"
    }
  ],
  "databases": [
    {
      "name": "drizzle",
      "version": "0.44.2"
    },
    {
      "name": "@neondatabase/serverless",
      "version": "1.0.1"
    }
  ],
  "betterAuth": {
    "version": "^1.3.24",
    "config": null
  }
}

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

Documentation, Client

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @michidk on GitHub (Oct 6, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Implement the middleware mentioned here using `getSessionCookie()` or `getCookieCache()`: https://www.better-auth.com/docs/integrations/next#middleware ```typescript import { NextRequest, NextResponse } from "next/server"; import { getSessionCookie } from "better-auth/cookies"; export async function middleware(request: NextRequest) { const sessionCookie = getSessionCookie(request); // THIS IS NOT SECURE! // This is the recommended approach to optimistically redirect users // We recommend handling auth checks in each page/route if (!sessionCookie) { return NextResponse.redirect(new URL("/", request.url)); } return NextResponse.next(); } export const config = { matcher: ["/dashboard"], // Specify the routes the middleware applies to }; ``` or ```typescript import { getCookieCache } from "better-auth/cookies"; export async function middleware(request: NextRequest) { const session = await getCookieCache(request); if (!session) { return NextResponse.redirect(new URL("/sign-in", request.url)); } return NextResponse.next(); } ``` 2. Build the project ``` $ next build ▲ Next.js 15.3.3 Environments: .env.local Creating an optimized production build ... ⚠ Compiled with warnings in 1000ms ./node_modules/better-auth/dist/shared/better-auth.DgGir396.mjs A Node.js API is used (process.platform at line: 74) which is not supported in the Edge Runtime. Learn more: https://nextjs.org/docs/api-reference/edge-runtime Import trace for requested module: ./node_modules/better-auth/dist/shared/better-auth.DgGir396.mjs ./node_modules/better-auth/dist/cookies/index.mjs ✓ Compiled successfully in 55s ``` ### Current vs. Expected behavior NextJS builds without warnings and the middleware works ### What version of Better Auth are you using? 1.3.24 ### System info ```bash { "system": { "platform": "linux", "arch": "x64", "version": "#1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025", "release": "6.6.87.2-microsoft-standard-WSL2", "cpuCount": 16, "cpuModel": "12th Gen Intel(R) Core(TM) i5-12500H", "totalMemory": "15.46 GB", "freeMemory": "9.07 GB" }, "node": { "version": "v22.15.0", "env": "development" }, "packageManager": { "name": "bun", "version": "1.2.13" }, "frameworks": [ { "name": "next", "version": "15.3.3" }, { "name": "react", "version": "19.1.0" } ], "databases": [ { "name": "drizzle", "version": "0.44.2" }, { "name": "@neondatabase/serverless", "version": "1.0.1" } ], "betterAuth": { "version": "^1.3.24", "config": null } } ``` ### Which area(s) are affected? (Select all that apply) Documentation, Client ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the nextjs label 2026-03-13 09:25:28 -05:00
Author
Owner

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

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

You're right—using getCookieCache() in Next.js Edge middleware currently triggers a warning because better-auth's internal environment detection references Node.js APIs like process.platform, which aren't supported in the Edge Runtime. This isn't an issue with getCookieCache itself, but with how it's imported and how the runtime is detected in the package, leading to the warning you see during build details.

This is a known limitation, and there are several discussions and issues about it in the better-auth repo (example). The maintainers recommend, as a workaround, to access the session cookie directly in middleware using:

export function middleware(request: NextRequest) {
  const cookie = request.cookies.get("better-auth.session_token");
  if (!cookie || !cookie.value) {
    return NextResponse.redirect(new URL("/sign-in", request.url));
  }
  return NextResponse.next();
}

If you use a custom cookie name or prefix, update the key accordingly. This approach avoids Node.js APIs and works in Edge Runtime.

Alternatively, if you need to use better-auth helpers that require Node.js APIs, you can set your middleware to use the Node.js runtime (supported in Next.js 15.2.0+), but this is experimental and not always recommended for production reference.

For now, direct cookie access is the most reliable solution for Edge middleware. If you want to track progress on a permanent fix, keep an eye on issues and PRs related to runtime compatibility in the better-auth repo.

To reply, just mention @dosu.


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

@dosubot[bot] commented on GitHub (Oct 6, 2025): <!-- Greeting --> Hi @michidk! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> You're right—using `getCookieCache()` in Next.js Edge middleware currently triggers a warning because better-auth's internal environment detection references Node.js APIs like `process.platform`, which aren't supported in the Edge Runtime. This isn't an issue with `getCookieCache` itself, but with how it's imported and how the runtime is detected in the package, leading to the warning you see during build [details](https://github.com/better-auth/better-auth/blob/30c28787f561f8bc43eb512f292699838817fa6e/packages/better-auth/src/cookies/index.ts). This is a known limitation, and there are several discussions and issues about it in the better-auth repo ([example](https://github.com/better-auth/better-auth/issues/2170)). The maintainers recommend, as a workaround, to access the session cookie directly in middleware using: ```ts export function middleware(request: NextRequest) { const cookie = request.cookies.get("better-auth.session_token"); if (!cookie || !cookie.value) { return NextResponse.redirect(new URL("/sign-in", request.url)); } return NextResponse.next(); } ``` If you use a custom cookie name or prefix, update the key accordingly. This approach avoids Node.js APIs and works in Edge Runtime. Alternatively, if you need to use better-auth helpers that require Node.js APIs, you can set your middleware to use the Node.js runtime (supported in Next.js 15.2.0+), but this is experimental and not always recommended for production [reference](https://github.com/better-auth/better-auth/issues/1973). For now, direct cookie access is the most reliable solution for Edge middleware. If you want to track progress on a permanent fix, keep an eye on issues and PRs related to runtime compatibility in the better-auth repo. <!-- 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/c81b5393-a34b-4a9e-b1df-ce1bb125a857?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/c81b5393-a34b-4a9e-b1df-ce1bb125a857?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/c81b5393-a34b-4a9e-b1df-ce1bb125a857?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/c81b5393-a34b-4a9e-b1df-ce1bb125a857?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c81b5393-a34b-4a9e-b1df-ce1bb125a857?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/c81b5393-a34b-4a9e-b1df-ce1bb125a857?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c81b5393-a34b-4a9e-b1df-ce1bb125a857?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/5120)
Author
Owner

@michidk commented on GitHub (Oct 6, 2025):

@dosu But the specific better-auth docs about nextjs middleware show this middleware code without switching to the nodejs runtime, which does not work. So we have code in the docs that does not work. At least there should be an hint about this if not a workaround.

@michidk commented on GitHub (Oct 6, 2025): @dosu But the specific better-auth docs about nextjs middleware show this middleware code without switching to the nodejs runtime, which does not work. So we have code in the docs that does not work. At least there should be an hint about this if not a workaround.
Author
Owner

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

You're right—the official better-auth docs for Next.js middleware show code that doesn't work in the Edge Runtime unless you switch to the Node.js runtime, which is experimental and not always recommended for production. The root cause is that better-auth's helpers (like getCookieCache and getSessionCookie) indirectly use Node.js APIs for environment detection, which aren't supported in Edge, leading to build warnings and runtime failures details.

There should absolutely be a warning or hint in the docs about this limitation. The most reliable workaround for Edge middleware is to access the session cookie directly:

export function middleware(request: NextRequest) {
  const cookie = request.cookies.get("better-auth.session_token");
  if (!cookie || !cookie.value) {
    return NextResponse.redirect(new URL("/sign-in", request.url));
  }
  return NextResponse.next();
}

If you use a custom cookie name or prefix, update the key accordingly. For full session/role access, you need to opt into the Node.js runtime, but that's still unstable in Next.js reference.

There's ongoing community feedback asking for the docs to be updated with clear warnings and secure, compatible examples for both runtimes example.

To reply, just mention @dosu.


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

@dosubot[bot] commented on GitHub (Oct 6, 2025): <!-- Answer --> You're right—the official better-auth docs for Next.js middleware show code that doesn't work in the Edge Runtime unless you switch to the Node.js runtime, which is experimental and not always recommended for production. The root cause is that better-auth's helpers (like `getCookieCache` and `getSessionCookie`) indirectly use Node.js APIs for environment detection, which aren't supported in Edge, leading to build warnings and runtime failures [details](https://github.com/better-auth/better-auth/issues/2170). There should absolutely be a warning or hint in the docs about this limitation. The most reliable workaround for Edge middleware is to access the session cookie directly: ```ts export function middleware(request: NextRequest) { const cookie = request.cookies.get("better-auth.session_token"); if (!cookie || !cookie.value) { return NextResponse.redirect(new URL("/sign-in", request.url)); } return NextResponse.next(); } ``` If you use a custom cookie name or prefix, update the key accordingly. For full session/role access, you need to opt into the Node.js runtime, but that's still unstable in Next.js [reference](https://github.com/better-auth/better-auth/issues/1973). There's ongoing community feedback asking for the docs to be updated with clear warnings and secure, compatible examples for both runtimes [example](https://github.com/better-auth/better-auth/issues/3037). <!-- 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/a999669e-7907-40df-9efc-f7ddd255019a?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a999669e-7907-40df-9efc-f7ddd255019a?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a999669e-7907-40df-9efc-f7ddd255019a?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a999669e-7907-40df-9efc-f7ddd255019a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a999669e-7907-40df-9efc-f7ddd255019a?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a999669e-7907-40df-9efc-f7ddd255019a?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/a999669e-7907-40df-9efc-f7ddd255019a?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/5120)
Author
Owner

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

couldn't reproduce this from my end. Make sure you haven't imported anything node related in your middleware. If getSessionCookie works getCookieCache should work as well since both are imported from the same route. If you're still facing the issue feel free to provide a repro and happy to take a look

@Bekacru commented on GitHub (Oct 6, 2025): couldn't reproduce this from my end. Make sure you haven't imported anything node related in your middleware. If `getSessionCookie` works `getCookieCache` should work as well since both are imported from the same route. If you're still facing the issue feel free to provide a repro and happy to take a look
Author
Owner

@michidk commented on GitHub (Oct 7, 2025):

Both don't work. I used the minimal middleware example provided in the docs.

@michidk commented on GitHub (Oct 7, 2025): Both don't work. I used the minimal middleware example provided in the docs.
Author
Owner

@michidk commented on GitHub (Oct 7, 2025):

@Bekacru please reopen this issue, here is a minimal repo:
https://github.com/michidk/better-auth-minimal

To create this I just executed: bun create next-app my-next-app , bun add better-auth and added the middleware from the docs.

Now run bun run build:

node ➜ /workspaces/better-auth-minimal $ bun run build
$ next build
   ▲ Next.js 15.5.4

   Creating an optimized production build ...
 ⚠ Compiled with warnings in 1422ms

./node_modules/better-auth/dist/shared/better-auth.DgGir396.mjs
A Node.js API is used (process.platform at line: 74) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime

Import trace for requested module:
./node_modules/better-auth/dist/shared/better-auth.DgGir396.mjs
./node_modules/better-auth/dist/cookies/index.mjs

 ✓ Compiled successfully in 7.4s
 ✓ Linting and checking validity of types    
 ✓ Collecting page data    
 ✓ Generating static pages (5/5)
 ✓ Collecting build traces    
 ✓ Finalizing page optimization    
@michidk commented on GitHub (Oct 7, 2025): @Bekacru please reopen this issue, here is a minimal repo: https://github.com/michidk/better-auth-minimal To create this I just executed: `bun create next-app my-next-app ` , `bun add better-auth` and added the middleware from the docs. Now run `bun run build`: ``` node ➜ /workspaces/better-auth-minimal $ bun run build $ next build ▲ Next.js 15.5.4 Creating an optimized production build ... ⚠ Compiled with warnings in 1422ms ./node_modules/better-auth/dist/shared/better-auth.DgGir396.mjs A Node.js API is used (process.platform at line: 74) which is not supported in the Edge Runtime. Learn more: https://nextjs.org/docs/api-reference/edge-runtime Import trace for requested module: ./node_modules/better-auth/dist/shared/better-auth.DgGir396.mjs ./node_modules/better-auth/dist/cookies/index.mjs ✓ Compiled successfully in 7.4s ✓ Linting and checking validity of types ✓ Collecting page data ✓ Generating static pages (5/5) ✓ Collecting build traces ✓ Finalizing page optimization ```
Author
Owner

@RealFinalCode commented on GitHub (Oct 7, 2025):

I also think this issue should be reopened I ran into the exact same error with a similar setup. And the workaround from the bot @dosu is not viable, because of the additional "__Secure-" prefix for secure cookies, which would need to be handled as well. That would just end up in tedious boilerplate code.

export function middleware(request: NextRequest) {
const cookie = request.cookies.get("better-auth.session_token");
if (!cookie || !cookie.value) {
return NextResponse.redirect(new URL("/sign-in", request.url));
}
return NextResponse.next();
}

@RealFinalCode commented on GitHub (Oct 7, 2025): I also think this issue should be reopened I ran into the exact same error with a similar setup. And the workaround from the bot @dosu is not viable, because of the additional "__Secure-" prefix for secure cookies, which would need to be handled as well. That would just end up in tedious boilerplate code. > export function middleware(request: NextRequest) { > const cookie = request.cookies.get("better-auth.session_token"); > if (!cookie || !cookie.value) { > return NextResponse.redirect(new URL("/sign-in", request.url)); > } > return NextResponse.next(); > }
Author
Owner

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

You're right—Better Auth sets secure cookies with a __Secure- prefix in HTTPS environments, but there isn't a built-in helper for Edge middleware to resolve both prefixed and non-prefixed cookie names without boilerplate. The recommended workaround is to manually check for both variants in your middleware, like this:

export function middleware(request: NextRequest) {
  const sessionCookie =
    request.cookies.get("__Secure-better-auth.session_token") ??
    request.cookies.get("better-auth.session_token");

  if (!sessionCookie || !sessionCookie.value) {
    return NextResponse.redirect(new URL("/sign-in", request.url));
  }
  return NextResponse.next();
}

This approach avoids Node.js APIs and works in Edge Runtime, but as you noted, it does introduce some boilerplate. There is currently no exposed utility or documented pattern in Better Auth to handle this automatically in Edge environments, and the official helpers (like getSessionCookie or getCookieCache) are not Edge-compatible due to their reliance on Node.js APIs and environment detection logic cite.

It would be helpful for the maintainers to expose a cookie name resolution helper for Edge middleware and update the docs to warn about this limitation and provide Edge-compatible examples. For now, the above pattern is the most robust way to handle both secure and non-secure cookie names in Edge middleware.

To reply, just mention @dosu.


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

@dosubot[bot] commented on GitHub (Oct 7, 2025): <!-- Answer --> You're right—Better Auth sets secure cookies with a __Secure- prefix in HTTPS environments, but there isn't a built-in helper for Edge middleware to resolve both prefixed and non-prefixed cookie names without boilerplate. The recommended workaround is to manually check for both variants in your middleware, like this: ```ts export function middleware(request: NextRequest) { const sessionCookie = request.cookies.get("__Secure-better-auth.session_token") ?? request.cookies.get("better-auth.session_token"); if (!sessionCookie || !sessionCookie.value) { return NextResponse.redirect(new URL("/sign-in", request.url)); } return NextResponse.next(); } ``` This approach avoids Node.js APIs and works in Edge Runtime, but as you noted, it does introduce some boilerplate. There is currently no exposed utility or documented pattern in Better Auth to handle this automatically in Edge environments, and the official helpers (like getSessionCookie or getCookieCache) are not Edge-compatible due to their reliance on Node.js APIs and environment detection logic [cite](https://github.com/better-auth/better-auth/blob/9b1c5d885d16c5101c089f09cce13f1da64dac0b/packages/better-auth/src/cookies/index.ts). It would be helpful for the maintainers to expose a cookie name resolution helper for Edge middleware and update the docs to warn about this limitation and provide Edge-compatible examples. For now, the above pattern is the most robust way to handle both secure and non-secure cookie names in Edge middleware. <!-- 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/dfdfacb1-d530-4870-a812-d3f57eba6467?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/dfdfacb1-d530-4870-a812-d3f57eba6467?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/dfdfacb1-d530-4870-a812-d3f57eba6467?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/dfdfacb1-d530-4870-a812-d3f57eba6467?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/dfdfacb1-d530-4870-a812-d3f57eba6467?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/dfdfacb1-d530-4870-a812-d3f57eba6467?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/dfdfacb1-d530-4870-a812-d3f57eba6467?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/5120)
Author
Owner

@michidk commented on GitHub (Oct 9, 2025):

@Bekacru is that minimal repo good enough or do you need something else?

@michidk commented on GitHub (Oct 9, 2025): @Bekacru is that minimal repo good enough or do you need something else?
Author
Owner

@leavism commented on GitHub (Oct 16, 2025):

Check what version of better-auth your project is using. I was on 1.2.7 and getCookieCache wasn't working. Bumped better-auth up to latest version and it worked.

@leavism commented on GitHub (Oct 16, 2025): Check what version of better-auth your project is using. I was on 1.2.7 and `getCookieCache` wasn't working. Bumped better-auth up to latest version and it worked.
Author
Owner

@michidk commented on GitHub (Oct 17, 2025):

@leavism as you can see in the minimal example, it happens indeed on the latest version: https://github.com/michidk/better-auth-minimal/blob/main/bun.lock#L21 (v1.3.27)

@michidk commented on GitHub (Oct 17, 2025): @leavism as you can see in the minimal example, it happens indeed on the latest version: https://github.com/michidk/better-auth-minimal/blob/main/bun.lock#L21 (v1.3.27)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#2082