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

how to execute some code on user signup, next auth 5

I have magic link auth and google oauth. I need to create default team in db for user when user signups but before he redirected to dashboard. What would be appropriate place to do it?
Solution:
found it. events.createUser . i though this event executed asynchoniously but it is actully awaited in auth flow so user is blocked while team is being created

T3.chat why is the chat api POST response after a prompt not in JSON?

Hi, I have been using t3.chat frequently - theo and his team's wonderful AI chat interface after seeing the video on it. I spend some time dissecting it and while looking over the network requests, I realized that the response from this endpoint https://t3.chat/api/chat is not in JSON. What it looks like ...

Invalid Signing Secret Error On UploadThing

I am using uploadthing for a project. Everything is working fine when I test it locally but on the hosted server I keep on getting the error invalid siging secret. I am using coolify for the hosting, The project is made using next js for the frontend and node js for the backend.

T3 Chat Temp Chat Feature

I was thinking of buying T3 chat and was wondering if they had a temporary chat feature, that works like a incognito chrome tab. Was wondering if this was a feature and if it wasn't if it would be added in the future.

Upload Thing: Callback Failed

Hello, I am getting this "Callback Failed" message and i was wondering what it meant? Thank you, Mooshay105...
No description

Environment port not used on a local PC

When I execute pnpm dev, the website loads under port 3000 (seems like the default one) but the .env have explicity PORT=3500 NODE_ENV=development ........
No description

Next js server actions

Hi, its my first time using server actions, i always use an api and make requests using react query, So I'm used to handling query invalidations, through react query, and now using actions, to simplify my code base, since it's a very simple project, would this be the best way to update data after removing files? by the way, does the code structure look correct?

upload video to firebase and show it in next js

Hello when i uploaded a video to firebase from nextjs project and tried to show it the console gives me this error video:1 Access to video at 'https://firebasestorage.googleapis.com/v0/b/video-tutorial-6f559.firebasestorage.app/o/videos%2Fmysql%20-%20no%20connection%20established%20or%20unable%20to%20connect%20to%20local%20host.mp4?alt=media&token=b7f221ba-553f-4ca7-aaea-4e387666cc06' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. ...

trpc with nextjs 15

Does it makes sense using trpc with nextjs 15? Because there is server actions too but that's not type safe.

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...