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

Struggling to Reduce Vercel Function Invocations on My Next.js Website – Need Optimization Tips!

I'm building a website using Next.js, Prisma, and MongoDB, but I'm encountering an issue with excessive Vercel Function Invocations. On a private Vercel account, I noticed that a single request can trigger anywhere from 19 to 100 function invocations, which feels extreme. I've already tried batching requests, server-side caching, and Incremental Static Generation (ISR), but the improvements are minimal. Does anyone have experience optimizing server-side actions for medium to large-scale projects? How can I effectively consolidate these invocations without sacrificing functionality? Any advice, strategies, or resources would be greatly appreciated! I am including stats from my Vercel Account where the app was hosted. I have paused the project because I don't want to end up homeless before AI takes my job....
No description

UT Download Speed question.

So I've noticed that hosted files on UT are downloading quite slowly, or at least slower than I thought. For example, a 150kb image sometimes takes 2 seconds to download or longer. I wonder why this is. I am assuming it has to do with some configuration mistake I made. I'm using "Frankfurt, Germany" region. Can someone advise? I don't even know how to start diagnosing the issue......

t3 chat [ Pro user ] Deepseek R1 stopped working suddenly and keeps running a loop.

It shows "an error occured" after a while.
Solution:
It works now, I don't what happened but now it works!
No description

What is the best "AI" tool to code?

So, I am very confused on what to settle on I tried cursor pro but it still have lots of bug that can affect productivity across large projects. ex: (ctrl+ click) (cmd+click) in some situations. so what is better? 1. co-pilot => slower not as smart...

"Favourite"/Pinned replies on t3.chat

Hi all! I recently subscribed to t3.chat and while I watch the stream when I can (UK timezone, sadly) - i'm not sure if there is a place to ask about t3.chat or recommend. Do you think it could be possible to add a 'pin' to t3.chat replies, similar to the pinned posts in Discord?...
Solution:
That's a good feature that I'm looking forward too! The T3 Chat channel is #t3-chat, although in order to always see it in the sidebar I had to right click on it and select add to channel list.

NestJS and DrizzleOrm question

Please tell me, I have a very complicated idea. I'm making an event app, events can be created by clubs, and a club can have people with the roles of President and Staff and only they can create events....
No description

Understand Vercel (serverless) cost structure

I have recently pushed a site to production / the public and getting about ~500 page views (250-300 visitors) a day (seen from vercel analytics). I am monitoring my costs and trying to get an understanding of how quick this site will burn through my hobby tier then move through -> pro -> pay per use. From reading through the usage tab, my main bottleneck seems to be Edge Requests. I had roughly 14k edge requests today and Im not completely sure why its so high. For context, the user, once logged in, spends most of the time on the landing page. They can search and browse for datasets.
Could someone help me understand this usage structure please. Happy to attach some images of the usage too!...

Rename based off fileKey

Hey, I am trying to get the rename api request to work. I'm getting a 400 syntax error: here's my call: {fileKey: "FLqidTvfTRqGKM6ccn4qVLgD7WCkX1pG5EIv42Pt8a093mYQ", newName: "Earnings_Statement-USDA.png"} ```...

Nextjs navigation after trpc mutation

I just found we have an issue while navigatig in browsers like safari/firefox but all working on chrome where after mutation I direct the user to the dashboard page where it should render new created data in the table. This bit of code after successful mutation it directs the user to the home page I can see it re-renders the server component and trpc query for table data is being trigerred but it still contains data - 1. After full browser refresh it contains data +1. Am I doing something wrong with refreshing next cache or somethign? ```ts...

Is Clerk a good choice to build a real auth management?

I want to give Clerk a try.... as you know auth-js is still in beta mode. is Clerk a good choice to be flexible and free from unexpected bugs?

Simulating low RAM

Related to https://discord.com/channels/966627436387266600/1330220446016208986 I believe the issue is because the users are running low on RAM and so their system is automatically disposing webgl resources. Is there any way locally to simulate low ram so I could force something like this to happen? Chrome dev tools only has CPU throttling...

Prisma doesn't update the db in my container

I have created a T3 app with postgres db. The start-database script creates a container as it should, but when I run npx prisma db push, nothing happens to db in my container, even though prisma says the db is in sync with my prisma scheme. I have opened the db in prisma studio and tried adding data, which gets stored, which leads me to believe there is a local database that prisma is connected to (?). I don't understand why it doesn't connect to my container db. I have a silicon mac, and this worked perfectly fine on both windows and linux pc as far as I know (could be irrelevant). The pictures attached are the commands I ran to make the db, proof that there is nothing in my container db in docker, and proof that there are columns in the db in prisma studio. I had to change out the username for my root username to even have access to the container, after some online digging:
DATABASE_URL="postgresql://gaute:postgres@localhost:5432/propulse-intern"
DATABASE_URL="postgresql://gaute:postgres@localhost:5432/propulse-intern"
. ...
No description

Twitch Re-sub confusion

So I cancelled the recurring membership for theo on twitch because I wanted to subscribe manually. Now I was like ill turn on the automatic payments. I clicked on to resume the automatic payments. I got charged $0.55, and it still says me that my subscription is ending and isn't renewed. I am really confused. (I am on tier 1)
Solution:
I mean twitch is weird with international subs apparently, for a local creator I pay 1,7x compared to Theo
No description

Cannot find module 'expo-asset/tools/hashAssetFiles'

hey everyone! ive just recently moved from normal repo to monorepo due to my stack, and currently i have turborepo-RN, and my expo app is in apps/native. however i have a weird issue: ``` iOS Bundling failed 6713ms apps/native/index.js (4553 modules) ERROR node_modules/expo-router/assets/unmatched.png: Cannot find module 'expo-asset/tools/hashAssetFiles'...

"Callback failed" in production.

Hello, I'm following the 0 to Production tutorial, using Vercel. Uploading files works fine in development locally, but in production the logs show that "callback failed". What could be the reason? I'm providing the latest audit log on the failed file upload: ```{ "url": "https://next-gallery-3x50b68ro-tiger-driver-xalizs-projects.vercel.app/api/uploadthing?slug=imageUploader",...

Why is UX popular for VS competitors?

I'm not technical on the development of these applications so bear with me but: Why do programs like zed.dev and trae initially develop for UX rather than windows? If I remember correctly Cursor was also like this but I know they have a Windows version now....
No description

Nuqs array toggle

How do I toggle value on nuqs array? Is this best way or is there other ways of doing it? ```ts "use client"; import { Button } from "@/components/ui/button";...

T3 Chat Subscription

Hey everyone, just saw t3 chat for the first time on yesterday's live. I'm a bit confused of what I'm getting with the pro subscription here. Chatgpt 4o and 4o mini are already available on chatgpt free tier as well as Claude 3.5 Sonnet. What is different about the what I get from t3 chat that I could not get from the free version of their original companies? I get the experimental models, I'm just a bit confused on the business model because I don't understand what I'm getting and the price a a lot cheaper than other subscriptions that I've seen on this space. Thanks in advance and I'm sorry if this was already answered before. I've tried searching but nothing answered my questions....

Does Upload thing allow for a folder structure?

I was thinking about using upload thing to handle file uploads for my mobile app. I don’t see an option to add folders to an app. Is it possible to create folders to categorize file uploads into different types? Ie profile pictures. Sorry if this is a dumb question but not seeing it in the UI

T3 Chat - Lost all chats after deleting cookies after not being able to access the app the whole day

I am unable to get all my chats. Please check this issue...
Solution:
I guess its a network glitch, cause in the better part of the day I was getting a 401 from your cloudflare gateways and I am authenticated. Now I have gotten back access to the chats after signing out and logging in the third time (Jan 22 2025)....