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

Logging / Metrics Best Practices?

What are some recommendation for logging and/or outputting metrics in a frontend application? My tech stack is as follows: - NextJs w/ Typescript - Supabase - Vercel...

SQL Querying Best Practices?

Just want to discuss query best practices. I using drizzle here but I'm just talking about SQL in general. ```ts const userAccount = await db.query.accounts.findFirst({ where: eq(accounts.id, userId), with: {...

tRPC SSG Helper w/ new Clerk middleware

So my goal is to do almost exactly what Theo does in his tutorial using the SSG helper for profile pages, but due to updated Clerk middleware I had to change my trpc.ts file. I have my trpc.ts file set up identical to this: https://github.com/perkinsjr/t3-app-clerk-minimal/blob/main/src/server/api/trpc.ts ...

Scaling Vercel Function instances & tRPC

On the "Functions" tab in my project I have api/trpc/[trpc]. Would this scale independently of any other edge function I'd create in api? For example, if I wanted to create an edge function to handle OpenAI calls and I knew it would possibly have longer latency would it scale to x instances independent of the "monolith" tRPC function which is just CRUD?...
Solution:
each api call spawns a lambda either way

What is the BEST ORM for Vercel Edge

I am trying to migrate to Vercel Edge. Currently using pg as my Postgress client, but it is not compatible with edge runtime. What do you guys suggest?...

React refs keep telling me ref.current.value does not exist on type 'never'

I've sent a few pics of where the error is. The function is responsible for checking whether a field among a set of required input fields is filled in or not. If one of them is not filled it will stop the function.
No description

Vercel CI/CD stopped working

Hello, I have been deploying an application connected to Github. Suddenly my pushes stop being deployed on vercel. How do I fix it?. I could disconnect and reconnect the github account but I would lose the current sub domain name I have chosen. I want to keep it. How do I trigger a deploy of the latest commit?...

Rust c++ building tools

hello im installing c++ build tools for rust development but the installer shows 6.4 Gb for that and i only want to use those tools for rust i wont use VS stuff so what should i unselect

Having issues deploying my t3 app to production using docker

Hi everyone, I am having trouble deploying my T3 app to my linux server when using docker and the output: "standalone" option. I have written a full description of that error on stackoverflow so maybe someone can help me out here or there. Thanks a lot https://stackoverflow.com/questions/76905472/network-issues-with-nextjs-t3-app-and-docker-on-production-environment-typeer...

Automated Migration Testing

Hey everyone. I'm building a new project using create-t3-app, where 24/7 uptime is really important. Therefore I want to be able to test my migrations. ...

clerk metadata

hello guys i never use clerk before and still using nextauth, the reason is if we use nextauth db strategy and i change something in user session while the user is still online, lets say i change the role directly in db, the user session automaticly change. if we using jwt strategy the user need to logout first and got the new session. in clerk i see people using the metada to insert their role, and we can update it, the question is what if the user is online using our app, and we want to update their metadata to differnt role, do we need to make the user logout first or it will automaticlly change, if yes im gladly migrate to Clerk๐Ÿ˜ Thanks!...

vite app + chrome extension

I'm trying to build a chrome extension that will work along side a traditional Vite app. I'm new to the web extension space and it's a bit overwhelming. There are a lot of plugins and frameworks that claim to be the best approach but they all do the same thing in different ways. I'd like to find a solution that is VERY simple and solves HMR in a reasonably good way. I'm currently considering the simplest approach i could think of, which consist of just adding additional entrypoints in my vite configuration to use the dist folder to contain the app + the web extension files (popup.html, background.js) etc. ...

Prisma client in Context

Hi, could anyone explain to me why this is recommended please?
We include the Prisma Client in Context by default and recommend using this instead of importing it separately in each file....

need a good redis hosting service

Need a Redis service: No credit card required. No trial. No phone number required. With persistence. Free. Minimum 10 MB persistence. Uptime 24/7. Minimum 100 MB RAM.

Help on choosing why i should use t3 stack for an e-learning web app

Hey guys, I wanted to make an e-learning app using the next.js and wanted to know if next.js and trpc could fully handle the backend issues. Since am doing stuff like progress tracking, rendering videos with high speed, authentication & autherization, payment processing and stuff could you guys explain how t3 stack could help me do that.

shadcn ui table

hello, shadcn ui table not responsive on mobile, if anyone ever encounter the same problem please letme know thanks!
No description

Suspense triggers weird bug

I have a component like this: ```ts async function Foo() { const { userId } = auth() if (!userId) return...

When using pnpm instead of npm, my .d.ts declaration files don't work.

I'm using this .d.ts file: ``` import type * as CSS from "csstype"; declare module "csstype" {...

How do I make Next App dir only run a function once? (Like getStaticProps)

Hi, I have a function called getLocalDevURL, but I can't seem to get it to properly run only once on the server, at build time. I am building an utility to generate a QR code, and for that I need to make getLocalDevURL run only once. ```tsx import { networkInterfaces } from "os"; import Image from "next/image";...

tRPC websockets, getting Typescript error on apply WSSHandler with createTRPCContext

Hey everyone! I am trying to use tRPC subscriptions and from my understanding, that means I need to us websockets rather than the standard HTTP links that ship with t3 stack.
I have an app created using ct3a, and I'm trying to incorporate the implementation described here: https://github.com/trpc/examples-next-prisma-websockets-starter...
No description