ぱいなぷー
ぱいなぷー
Explore posts from servers
BABetter Auth
Created by ぱいなぷー on 3/4/2025 in #help
Inferred Type Cannot Be Named with Nanostores
I'm encountering the following TypeScript error when trying to set up authentication.
import { createAuthClient } from "better-auth/react";
import { magicLinkClient } from "better-auth/client/plugins";

export const authClient = createAuthClient({
baseURL: "http://localhost:3000",
plugins: [magicLinkClient()],
});
import { createAuthClient } from "better-auth/react";
import { magicLinkClient } from "better-auth/client/plugins";

export const authClient = createAuthClient({
baseURL: "http://localhost:3000",
plugins: [magicLinkClient()],
});
The error message is:
The inferred type of 'authClient' cannot be named without a reference to '.pnpm/[email protected]/node_modules/nanostores'. This is likely not portable. A type annotation is necessary.
The inferred type of 'authClient' cannot be named without a reference to '.pnpm/[email protected]/node_modules/nanostores'. This is likely not portable. A type annotation is necessary.
I'm using Turborepo and have TypeScript enabled in my setup. How can I resolve this error? Do I need to add a type annotation somewhere, or is there a better way to handle this issue in a monorepo with Turborepo? Thanks in advance for any help!
5 replies
BABetter Auth
Created by ぱいなぷー on 2/28/2025 in #help
How to Retrieve DATABASE_URL in Cloudflare?
I'm using Hono and Drizzle with Cloudflare. How do you properly retrieve DATABASE_URL? Any advice would be appreciated!”
4 replies
HHono
Created by ぱいなぷー on 11/3/2024 in #help
"Error: 'c.header is not a function' in Hono setCookie with tRPC Integration"
I'm encountering an error in my Hono and tRPC setup when attempting to set a cookie after user registration. The error message is:
TypeError: c.header is not a function. (In 'c.header("Set-Cookie", cookie, { append: !0 })', 'c.header' is undefined)
TypeError: c.header is not a function. (In 'c.header("Set-Cookie", cookie, { append: !0 })', 'c.header' is undefined)
const t = initTRPC.context<Context>().create();

const publicProcedure = t.procedure;
const router = t.router;

export const authRouter = router({
register: publicProcedure.mutation(async ({ ctx }) => {
const token = "exampleToken"; // Example token generation

setCookie(ctx, "token", token, {
path: "/",
secure: process.env.NODE_ENV === "production",
httpOnly: true,
maxAge: 60 * 60 * 24 * 30,
sameSite: "Lax",
});

return { message: "Registration successful!" };
}),
});
const t = initTRPC.context<Context>().create();

const publicProcedure = t.procedure;
const router = t.router;

export const authRouter = router({
register: publicProcedure.mutation(async ({ ctx }) => {
const token = "exampleToken"; // Example token generation

setCookie(ctx, "token", token, {
path: "/",
secure: process.env.NODE_ENV === "production",
httpOnly: true,
maxAge: 60 * 60 * 24 * 30,
sameSite: "Lax",
});

return { message: "Registration successful!" };
}),
});
1 replies