baddra
baddra
TTCTheo's Typesafe Cult
Created by Pavstermeister on 11/5/2023 in #questions
Configuring Clerk on the latest release of t3 with tRPC
Using a caller fixes all my problems, but I had to tweak server.ts to make it build without errors, but still havent solved the issue using the proxyclient
import "server-only";
import { headers } from "next/headers";

import { appRouter } from "@/server/api/root";
import { auth } from "@clerk/nextjs";
import { db } from "@/server/db";

export function caller() {
// cant use auth() outside a function, build fails
return appRouter.createCaller({
auth: auth(),
headers: headers(),
db,
});
}
import "server-only";
import { headers } from "next/headers";

import { appRouter } from "@/server/api/root";
import { auth } from "@clerk/nextjs";
import { db } from "@/server/db";

export function caller() {
// cant use auth() outside a function, build fails
return appRouter.createCaller({
auth: auth(),
headers: headers(),
db,
});
}
123 replies
TTCTheo's Typesafe Cult
Created by Pavstermeister on 11/5/2023 in #questions
Configuring Clerk on the latest release of t3 with tRPC
123 replies
TTCTheo's Typesafe Cult
Created by Pavstermeister on 11/5/2023 in #questions
Configuring Clerk on the latest release of t3 with tRPC
I don't know how merging routers affects a caller but I understand that the previous method makes an API request, and you define the runtime in /api/trpc/edge/[trpc]/route.ts. By using a caller, it doesn't make an API request, so you are now responsible for setting the runtime in the appropriate page.tsx routes
123 replies
TTCTheo's Typesafe Cult
Created by Pavstermeister on 11/5/2023 in #questions
Configuring Clerk on the latest release of t3 with tRPC
based on what theo said on today's stream a solution would be replacing server.ts to:
import "server-only";
import { headers } from "next/headers";

import { appRouter } from "@/server/api/root";
import { auth } from "@clerk/nextjs";
import { db } from "@/server/db";

export const api = appRouter.createCaller({
auth: auth(),
headers: headers(),
db,
});
import "server-only";
import { headers } from "next/headers";

import { appRouter } from "@/server/api/root";
import { auth } from "@clerk/nextjs";
import { db } from "@/server/db";

export const api = appRouter.createCaller({
auth: auth(),
headers: headers(),
db,
});
123 replies
TTCTheo's Typesafe Cult
Created by Pavstermeister on 11/5/2023 in #questions
Configuring Clerk on the latest release of t3 with tRPC
Did anyone solve it?
123 replies
TTCTheo's Typesafe Cult
Created by Jacob on 7/15/2023 in #questions
Drizzle not pulling in environment variables
If you are using planetscale you need these variables
8 replies
TTCTheo's Typesafe Cult
Created by Jacob on 7/15/2023 in #questions
Drizzle not pulling in environment variables
8 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 2/19/2023 in #questions
Incorporate Rust into t3 stack
I haven't really looked much into it but I think rspc may be a good fit for writting rust api's https://rspc.dev/
13 replies