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

switch function in drizzle

I'm following the "Add Clerk Authentication & Stripe Payments to your NextJS tRPC Application" tutorial. The tutorial uses T3 app + Prisma + Clerk. I've used drizzle for my T3 app and need help converting this switch function written in Prisma-speak to Drizzle-speak....
No description

Everyone help me, how to handle server component error?

Code: ``` import { api, HydrateClient } from "@/trpc/server"; import { columns } from "./columns"; import { DataTable } from "./data-table";...

Table "appointment" does not exist in the current database error, but other routes do alright

Hi. I'm using T3 with App Router and I am running into an issue with tRPC and Prisma. I have an appointment tRPC router that handles and returns data from Prisma. I have a page where all appointments are rendered within a table - everything fetches just fine. But when I want to perform a mutation of one appointment, tRPC spits out a Prisma error saying that the appointment table doesn't exist. There are no steps to reproduce, unless it has something to do with creating a trigger manually through the command line in PSQL.
How can I fix this?...
Solution:
Ugh, I love trying for hours to no avail, posting a question and solving it within 10 minutes. It was the trigger returning an error every interaction because I misspelled a relation.

Return mapped data in fetch, or map in components?

Which do you prefer and why? Alternatively, what are the use cases for each?

Tanstack Table. flexRender

What is this flexRender? How can I use markup with him? How does it work? Is there any documentation about it?
No description

can anyone help me to bundle t3app for electronjs?

i want to build desktop application using t3 stack.

Redirects in next.config.js - App Router - NextJS 14

Hi guys, I was wondering how can I make a redirect with a nagavite lookahead in the slug. Let's say I have these two routes: - /blog/new - /blog/:id/overview...

Auto select language react app

I'm not a front-end man, how can i have my website in english for all people outside my country? and my language if you open website from my country? I'm using react šŸ™‚
Solution:
Change the language in browser settings

My uploadthing callback endpoint seems to be serving a 400 but i haven't been able to debug why

It works in dev, but now that I've pushed to prod. I'm seeing this error in my logs,
"\u001b[41m\u001b[30m āØÆ UPLOADTHING 2:09:44 AM \u001b[0m Invalid signature"
"\u001b[41m\u001b[30m āØÆ UPLOADTHING 2:09:44 AM \u001b[0m Invalid signature"
but not sure how/why...
Solution:
Damn I got it -- it's on a cloudflare worker. Buffer doesn't exist

T3 Next Auth / TRPC Documentation is outdated

I noticed t3 is using next-auth v4 instead of v5 (makes sense, 5 is in beta still). But reading through the docs is still confusing since the links are between v4/v5 and next pages/app router. Does anyone have any reliable sources/examples for a next-auth v5 t3 implementation?...

drizzle

Just a heads up, if you are having issues using, run db:push and get these error messages, please try connecting to another network and do the push again, your provided ip might be blacklisted, or your isp might have them blacklisted:thinkies: , after connecting to my hotspot i was able to do the push and connect to drizzle studio without issues
Solution:
Just a heads up, if you are having issues using, run db:push and get these error messages, please try connecting to another network and do the push again, your provided ip might be blacklisted, or your isp might have them blacklisted:thinkies: , after connecting to my hotspot i was able to do the push and connect to drizzle studio without issues
No description

applying migrations...Error: getaddrinfo ENOTFOUND postgres

Hi Guys , I am using nextjs app router with drizzle with postgres and its working fine in development mode but when i am running it with docker compose up --build its giving me this error ``` [ā£·] applying migrations...Error: getaddrinfo ENOTFOUND postgres 1.013 at /app/node_modules/pg-pool/index.js:45:11...

What's the best logging service for nextjs?

I am currently looking for a good logging service for my nextjs application, i have gone and tried axiom which i liked however reading through things seemed to run pretty slow in server function with having to clean up afterwards (flushing). I am currently using posthog for my analytics which i really love. ...

t3 tRPC - CTX is undefined

Hey all. Finally checking t3 for the first time. Question. I was trying to add to the latest post query so that the latest post will be from the current user not all users....
No description

trpc prefetch fails when building app

tRPC fails to get the data when it is build the application as the tRPC server cannot run when building. Any thoughts on how to fix this issue? ```tsx...
Solution:
export const dynamic = "force-dynamic";
export const dynamic = "force-dynamic";
...

Server actions in server components

I have been under the assumption that calling a function marked with use server on the server is just treated as a regular server function. But I then stumbled upon a random vid where the guy mentions that calling a server action from the server means the server will be fetching from what's effectively an API route the same way client components do. Couldn't find explicit evidence for this claim though. ...

does the interviewer (technical interviewer) or dev responsible for hiring review your projects code

I am refactoring an old project it's an ecommerce project i didn't have the option to view the product in a seprate page so i wanted to add that option , I have my products stored in an Array in firebase now that i understand firebase more i learned that i can't use it's querying capabilities to filter my results instead of having to loop over the whole Array to get the item i want it's a total of 226 items i know that if i add more products it will effect performance later there is two cho...

Server side data fetching based on input from a client

So, I want to fetch data on the server with server components based on the input from the client component in this case workspaceSlug. What is the best approach to go around this? I tried the pattern in this picture i havent got it to work
No description

trpc useQuery/useMutation not inferring return type of prisma query

Env: Node18 , npm i'm using turborepo with the server as Honojs + hono-trpc adapter and the client as react vite So i've already did the setup as said in the docs and everything is working perfectly everything returned from the trpc procedures is inferred except when i return a prisma query then the inferred type is "any" ?? ...
Solution:
i solved it so it was an error with the context which contains (prisma and telegram bot) not being inferred from the client so i had to type it manually now all returned prisma queries works as expected...
No description

AWS Amplify & T3 stack env var issue

Iā€™m small app with for now only auth and is not detecting env vars on amplify I created with next auth, tailwind and nothing else. On the logs I only see that the next auth and provider env vars are not detected with the message that they are required...