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

NextJS dynamic routes with „use cache“ and dynamicIO - examples?

Hi everyone 😃 Does anyone have an example with an cached dynamic route in the new dynamicIO way of doing it? Even though I saw an issue on GitHub, I can’t believe it’s in general not possible. I basically need a very common example for something like a blog....

React error

Hi everyone! I’m facing the following error when I click a custom “Save Changes” button in my React app: “Uncaught Error: A React form was unexpectedly submitted.” The button programmatically submits a form using form.submit() in the onClick handler. The form is a React component with an action tied to a server function....

Zustand question

```ts const useStore = create((set) => ({ count: 0, increment: () => set((state) => ({ count: state.count + 1 })), decrement: () => set((state) => ({ count: state.count - 1 })),...
Solution:
okay i am dumb, should have read docs better

Problem with t3 chat pro

I bought it yesterday, and I do get quite a lot of 'Stream failed for unknown reasons' or 'Uncaught exception' errors. After it encounters an uncaught exception, there is no way to recover that particular chat—you have to create a new one. Here is an example
No description

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