Argument of type is not assignable

Hello! I just updated to Better Auth v1.3 to try out the new SvelteKit cookies plugin, I'm using the code on the changelog but I'm getting this problem on getRequestEvent in VS Code:
Argument of type '() => RequestEvent<Partial<Record<string, string>>, string | null>' is not assignable to parameter of type '() => Promise<RequestEvent<Partial<Record<string, string>>, string | null>>'.
Type 'RequestEvent<Partial<Record<string, string>>, string | null>' is missing the following properties from type 'Promise<RequestEvent<Partial<Record<string, string>>, string | null>>': then, catch, finally, [Symbol.toStringTag]ts(2345)
Argument of type '() => RequestEvent<Partial<Record<string, string>>, string | null>' is not assignable to parameter of type '() => Promise<RequestEvent<Partial<Record<string, string>>, string | null>>'.
Type 'RequestEvent<Partial<Record<string, string>>, string | null>' is missing the following properties from type 'Promise<RequestEvent<Partial<Record<string, string>>, string | null>>': then, catch, finally, [Symbol.toStringTag]ts(2345)
Here's the code:
import { betterAuth } from 'better-auth';
import { twoFactor } from 'better-auth/plugins';
import { sveltekitCookies } from 'better-auth/svelte-kit';
import { getRequestEvent } from "$app/server";

export const auth = betterAuth({
plugins: [twoFactor(), sveltekitCookies(getRequestEvent)],
...
import { betterAuth } from 'better-auth';
import { twoFactor } from 'better-auth/plugins';
import { sveltekitCookies } from 'better-auth/svelte-kit';
import { getRequestEvent } from "$app/server";

export const auth = betterAuth({
plugins: [twoFactor(), sveltekitCookies(getRequestEvent)],
...
It looks like it's working correctly so it may just be cosmetic. Thank you!
Solution:
sveltekitCookies(async () => getRequestEvent()) seems to have resolved this for me
Jump to solution
1 Reply
Solution
restart
restart2mo ago
sveltekitCookies(async () => getRequestEvent()) seems to have resolved this for me

Did you find this page helpful?