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

Bread-Crumbs Navigation

Hey guys, i'm setting up a side project with a design from Figma and i came across this type of in page navigation. i realize i saw something similar to that in the Next.js official website and i want to know how to implement it properly. Maybe a UI library like shadcn or with tailwind or anything, i'm just randomly guessing.

Shadcn Ui library select is not working Properly in mobile?

hello guys, I am facing an issue with shadcn ui Select when I am clicking button it is also clicking the button which is right below it how can the issue can be resolved? (use toggle between device and choose any mobile)...

nextauth with external api

out of curiousity is sending the id of user in a cookie and then querying the db the only way when we want to get user data on an external api knowing that i managed auth with nextauth

14 vs 15inch Macbook Pro... Help!

Hey! I know this isn't really a really a programming related question... just wanted to get some other programmers thoughts on form factor. I'm currently typing this on a 13inch macbook pro and am looking to get an upgrade. So just one question...

Union types to solve magic strings problems

With the union types of typescript you are solving the problems of magic strings ? Or it's better to make an object?

Build failed when using trpc and strict tsconfig

Can I somehow ignore this error from node_modules? For some reason typescript still checks node_modules and importsNotUsedAsValues and noImplicitOverride causing me problems. I read somewhere that this happens because trpc uses .ts instead of .d.ts I have this tsconfig. `{...

Buying a new Mac, How important is the Chip or having >16GB ram

I saw theo's recent tweet about definitely not getting a mac pro and getting a mac studio instead, and it reminded me how bad my current personal computer is. I would like to upgrade to an m1 / m2 era computer but am not sure how hard to go on it. My needs are as follows: • Probably would prefer a laptop as I work outside all the time • Audio Production • Rarely / Occasionally Video Production...

React-hook-form dynamic input

Repo: https://github.com/Parthvsquare/marquee-test Issue: The subtask input should be dynamic so i used useFieldArray, but i am getting some undefined values in there. Could someone help me to figure out what i did wrong (this was a test, but i obviously failed) just want to learn how to use dynamic input...

Invalid `prisma.product.findMany()` invocation

So I was working on some filtering on a query for my Prisma DB and managed to bork the DB. Not sure what's going on. This is the error message: ``js prisma:error Invalid prisma.product.findMany()` invocation:...

ISR (+ on demand revalidation) NextJS on Netlify not working

ISR on Netlify seems rough. Various threads and form pages going around. There seems to be partial support - as in - ISR using the revalidation property in getStaticProps should "just" work according to this https://docs.netlify.com/integrations/frameworks/next-js/incremental-static-regeneration/ page. Some further down the page it is mentioned that on-demand revalidation is indeed not supported somehow... Annoying enough on-demand is not working. My pages are never revalidated when using the revalidation either....

help with basic ts error

prisma schema ```ts model User { id Int @id @default(autoincrement()) /// @zod.string.min(2, { message: "Must be between 2-12 characters" }).max(12, { message: "Must be between 2-12 characters" })...

Prisma query multiple tables

So, I have 3 tables that need to be queried. Their schema are very much alike, underlined fields are basically shared between them. I need to 'join' them, I guess, and do a pagination based on timestamp. How would I go about doing this?...

tRPC query with HTTP POST

I'm writing tRPC queries with relatively large amounts of data in the payload (query string), which is (in some cases) exceeding the browser's limit for HTTP GET request length. Is it possible to configure tRPC to use HTTP POST for queries (e.g. similar to how GraphQL works)? (I see these are queries rather than mutations as i am not changing anything on the server - and I prefer the declarative syntax of useQuery vs useMutation).

YouTube Data API

Hi, I would like to write a script, that get the channel_id from a channel url. For this, I was trying to use the username: https://www.youtube.com/@t3dotgg -> t3dotgg https://youtube.googleapis.com/youtube/v3/channels?part=id&forUsername=t3dotgg&key=[YOUR_API_KEY] but I get this response:...

Mocking TRPC api with Jest.mock

Im trying to mock the api to create my first test using the t3 stack. It is always undefined. here is my config ts.config ``` "baseUrl": ".",...

Does NextAuth refresh access_token automatically?

As the title says I was wondering about refreshing the access token, Does NextAuth does that automatically? Or as the docs say, you have to implement it manually? https://authjs.dev/guides/basics/refresh-token-rotation#jwt-strategy ``` // https://accounts.google.com/.well-known/openid-configuration...

How to load all these images at once?

Hi! How could I increase the user experience by avoid these images to be loaded when the filters change? https://lineage2guides.vercel.app/manor-calculator I would like to load and cache all the images before the user plays with filters....

Component in App.tsx showing ts error:

'Component' cannot be used as a JSX component It doesnt seem to break anything, but is there somethign wrong with my setup?...