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

UploadThing: reuse a custom id

I would like to have a static URL for each users profile image. I'm not sure if uploadthing supports this or if its even a good idea I've been telling uploadthing to use the same custom id for a new file (after deleting the original) and it has not been accepting the upload. does this mean once you use a custom id it cannot be used again?...

Can't upload Opus audio files to uploadthing

I'm getting genereated audio files from elevenlabs as opus files and no mime type works. I've tried ogg, opus, and webm. this is the error I get: "body":{"error":"Mismatched file type"}. It seems like uploadthing can't recognize this format

How to extract correct coordinates from the image based on feedback

so im working on a project which is AI Assisted Design feedback web app, im sending a design image to the backend, open ai gpt 4 analyses that image and sends back feedback and the coordinates in form of rectangle which encircle the part of the image the feedback is about, but the issue is the ai is not able to give proper coordinates about the part of the image that it is giving feedback about, how can i fix this..? i want to highlight parts of image, for which im using coordinates, but it seems the open ai hallucinates and isnt able to give proper coordinates for this would love to know if theres a way to fix this problem...

How to avoid optional chaining in TS?

Hey there, I can't remember the recommended pattern for this and I actually feel like Theo covered it once in a video but: How do we avoid an optional chaining scenario and implement clean optional/interchangeable interfaces....

should i have a sepreate slice for different part of the zustand state

i 'm using zustand for state in my next js app i currently have one store holding state of different parts of the application first question is there any issue with this implementation , second i wanted to edit a message in my chat app i wanted to display a input element instead of the message so the user can edit the message given my implementation here are my options 1 ) pass down a setState function...

YT VOD playlist

Hey does anyone have a link to the VOD playlist on YouTube? I asked Theo about it yesterday on stream and he said it’s hidden but still accessible.

Is there a Forum where „SMART“ people have Discussions about AI Tools & Agents

Every other Month a new Model comes out and Coding Agents and CLIs also change on a regular basis. I’m trying to keep up with some of these developments but it seems to me like every subreddit is filled with 95% „Chatbot Vibe Coders“ that have no Idea what they are actually talking about. Do you guys know about a Community that actually Cares about these Topics and has a Data driven opinions about these developments?...

How to get NextAuth session object in a React Client Component?

I'm new to working with Next.js 15 and NextAuth, created with create-t3-app. I'm trying to get the session object exported by the auth() function, it works fine in Server Components, but when I use the "use client" directive, I can no longer access it. Now this is no surprise, but I was wondering if there was a way to get the session object in a Client Component? Thanks for any answers/insight 🙏

Thoughts on next forge

Curious about y’all’s thoughts on https://www.next-forge.com/, Especially given Theo’s recent stack video.

No response on sponsorship with Theo

Hi there! Just checking in to see if an admin might catch this. We recently reached out via the sponsorship email about a potential sponsorship with Theo (inviting him to keynote an online conference), but haven’t heard back. Just wanted to confirm whether the message didn’t reach the right people or if there’s no interest....

create-ts-app error

create-ts-app error with message using pnpm create t3-app@latest Formatting project with eslint... ⠧ Running format command Aborting installation... Error: Command failed with exit code 1: pnpm run format:write ...
Solution:
This seems to be caused by accepting the default import alias

Using UploadThing as Storage in Payload CMS errors on Vercel

I am trying to use UploadThing as my storage option working with Payload CMS. I am using their recommended adapter: https://www.npmjs.com/package/@payloadcms/storage-uploadthing ...

React Bundle exposes all pages/endpoints code without auth?

I've done a lot of legacy and vanilla frontend stuff, but I'm new to React and somewhat SPAs. I've watched the intro to react v9 from Brian Holt on FrontendMasters, and auth wasnt discussed. So now as I'm trying to apply my new skills to a legacy coldfusion codebase (all SSR, almost no JS anywhere), I tried to start by recreating the header/navbar component, to which I realized its a bunch of role based access to even render those links in the first place. So I've tried chatting with copilot and GPT and google searching, but I dont entirely know what to search and what answers to believe. So I'm trusting that maybe the React Gods here can clarify what is 'good' and 'bad' behavior....

Where can i find Near Vault Contract?

It would be nice if someone can point me to the near vault contract that is deployed on mainnet.

Want to have carrier discussion with a SWE.

I am a 19 yo 3rd semester EE student, who love programming. I am currently working on a terminal chess engine in C++ for resume, that uses async multithreaing, with a skheduler thread, input thread(works as a shell/input function), and the main thread. all this fancy stuff, not just for nothing, but to make features like,very interactive input system, a notification bar,etc, and stuff like theme command, help command and pawn promotion option are in progress. also, uses two producer consumer patterns, one for giving commant to the main thread, and the other to give comand to skheduler to when to give a command to the main queue, and also used two condition variables, so the main and input thread(function thingi) can sleep while waiting for producer consumer main queue to be !empty and the key press to happen respectively. also, this thing needing me to deal with debugging deadlocks, and race conditions. despite of all this, my project isn't complete, and it's not much presentable and flashy, though it covers almost all the chess rules that i saw in a 20 min rules of chess video. and i need to work on many things so i can call it somewhat complete. and no gurantee that it's fully race conditions proof, even though i couldn't find much. thus, i would like to have casual carier discussion with someone who is a good a software engineer, about like what direction should i chose, and stuff, or whoever you think, is more relivent, pls let me get in contact with him ty 🙂...

don't store user permissions in database

In recent video theo gave example against storing user permissions in database as done in firebase and supabase. Can someone please provide me with some more resources so that I can read why that is a bad practice and what are better practices around it....

react + express/fastify monorepo to vercel

Any of ya'll have any idea how to deploy a react + express/fastify monorepo to vercel? I'm aware that vercel has a guide for standalone express/fastify, but none for one inside a monorepo I've tried a lot of things and a lot of editing to the vercel.json thing, nothing worked ...

How does gpt prompt caching work on openrouter?

Caching with any provider that supports it works great, but not openai. For example i have a system promt that is 1500 tokens long on o200k_base encoding, i send a request to gpt-5 using openrouter, and i get this output (CompletionUsage(completion_tokens=27, prompt_tokens=1574, total_tokens=1601, completion_tokens_details=None, prompt_tokens_details=None)) which indicates that none of the tokens were cached. What could be the issue? doc: https://openrouter.ai/docs/features/prompt-caching...

how does LLM applications scale?

Sorry for sounding like a layman; The thing is, providers like OpenAI have something known as TPM (tokens per minute) limits. So, how do people build applications around it when multiple users are using it simultaneously? Let's say I'm creating a feature like Deep Research, and due to the TPM limit, I can only run one research process at a time. If I exceed the limit, it will throw a TPM error again; hence making it not so possible for me to even test a pilot for my application. Thanks!...