Theo's Typesafe Cult

TTC

Theo's Typesafe Cult

Join the community to ask questions about Theo's Typesafe Cult and get answers from other members.

Join

tRPC SSG - Page rendering error

Hey 👋 I just set up tRPC with SSG to prefetch some data in getServerSideProps. I get this error when I try to load the page. Any ideas? Thanks....

How to add more keys to session with next auth

how do i add more keys to the session which next auth creates thank you...

upload image using supabase

does anyone had a method to upload multiple image and save it to db using trpc endpoint? (im using supabase) thanks in advance...

Save me from git

When I do: "git commit -m "initial commit"" It says it tries to track files that are not in my actual folder, but the files from my user folder! I have a git config in my user folder that I just edited, maybe that made it happen somehow. Anyone has any idea what to do with this sh*t?...

Best way to force Vercel build to fail If certain code is included?

Does anyone know a way to force a Vercel build to fail if a certain piece of code exists?

useQuery refetching doesn't re-render?

Is this expected behavior? I can't find anything about it online, but I really thought it would make sense to force a re-render similar to when updating a state in the component. Can someone help me figure out the conventional way of re-rendering when useQuery hook refetches and gets new data?

How to setup and teardown database records when running integration tests with trpc?

Currently, I'm doing this but it seems impractical to do with more tables in the database. Is there an alternative approach? ```ts afterEach(async () => { const ctx = await createContextInner({ session: null,...

Securing parametrized routers

Hi! I want to generate a bunch of pages and that each belong to an individual outside of the application, lets call them customers. (Using T3) So I have a parametrized route like this: ...

Need help in OOP

```ts class Shape { radius: number; length: number; breadth: number;...

trpc + Auth0 + turborepo

Hello! I want to build a sass web and mobile application that follows the create-t3-turbo repo. Expo does not support nextAuth so I was wondering what are the implications when using two different auth tools for the apps? I was thinking using auth0. I am using prisma / trpc and most of the examples out there are integrated with just nexAuth. Second question, does anyone have a good repo that uses these tools? Mainly configuring the auth0 middleware with trpc?

How do you switch from main branch to development branch in Planetscale + Prisma?

Trying to
npx prisma db push
npx prisma db push
but I keep getting this error

HookWebpackError during `next build`

Hi! I've been trying to run npm run build since I'm slowly getting closer and closer to deploying my app. The traceback given by webpack only points to minified files which gives me no clue about where to even start debugging this. I've tried adding productionBrowserSourceMaps: true to my next config but that didn't help at all (produces the attached error). I'd be super grateful of any pointers of where to go next. If it is of any relevance (seeing as the error is a CssSyntaxError) I am using tailwind...

Stop Pnpm moving packages installed by different package manager to .ignored

So basically any time I run pnpm add or install commands. It will move packages installed by another package manager to .ignored, I want it to stop moving them.

How to get result of a trpc query in a use effect

I often use mutateAsync for mutations, but ive never had to do a query. Any examples? I dont think im searching for the right thing in the docs.

content starting at a certain height

whats the best way to get content to start at a fixed position for example 25% height from the top on a 100% height page? just something like padding-top 25%? or is it better to use something like rem? and is there any good shorthands for this in tailwind?

Does tRPC replace client-side form validation i.e react-hook-form?

As you know tRPC has input validation in the router, but if you wanted to still have client side validation in your actual form, should you still use something like react-hook-form? I looked at the docs, and it only shows a general error i.e <pre>Error: {JSON.stringify(mutation.error.data.zodError, null, 2)}</pre> Is there a way to display particular field errors from the mutation? Something like mutation.error.data.zodError.title for example. Thank you for your time....

302 error when logging in with Discord

I have just done a fresh creation of t3-app, but i'm getting a 302 when the redirect URL is called for discord, same as this thread mentions https://github.com/t3-oss/create-t3-app/issues/952 However I am on next-auth version 4.18.6, any one else seen this?...

How to use useMutation with create t3 app

i tried implementing useMutation but i could not get it to work... i tried this (https://trpc.io/docs/useMutation) solution i found on the trpc docs but could not get it to work any help is appreciated!...

tRPC, Nextjs GetServerSideProps and satisfies error.

Hi guys, for some reason, when i use "satisfies" operator in a Nextjs getServerSideProps, i can't use tRPC SSGHelpers or Prisma Client. I'm getting this error, "ReferenceError: createProxySSGHelpers is not defined" and crash my app. But when i remove satisfies operator, all error are gone and my app is running again. What happen here? Example: export const getServerSideProps = (async (ctx) => { const prisma = new PrismaClient();...

Prisma - creating row with empty array fields

Hi, I have a user table in which I have a reference field of the Story table, written like this: story Story[] When I create a new user, since this field cannot be optional in prisma, I write it like this: `return await prisma.story.create({...