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

docker lags my pc

Heyy I've wanted to try Docker since it's something many people mention, but after installing Docker Desktop when I launch it, it makes my PC lag really bad. I'm on windows 10 and have 8gb RAM, it's not much but I didn't expect it to make it unusable. Anyone know something about this?

Dynamic subdomains

Hi, I would like to setup custom subdomain to act like a slug, something like: [slug].mysite.com. I thought of using nginx that reverse proxy that will swap the subdomain to the slug in the background. So something like this: subdomain.mysite.com/hello -> mysite.com/subdomain/hello....

VR dev setup

Anyone here write code in VR? This blog got me really interested on trying it out: https://medium.com/immersedteam/working-from-orbit-39bf95a6d385

EAS Build Failing without error

hey guys, i have updated to expo 48, and run npx expo-doctor amd npx expo install --fix however it seems to not build past this point.... The last version i used was expo sdk 46, and builds were working...

Help debugging crash only on mobile browsers

If you go to my site https://truefinals.com/tournament/0d4329c50c1b3535 and use the pinch / zoom feature the site crashes. Simply zoom out a little and wiggle your finger around and youll see the page drops frames (which im ok with given how heavy this animation is) before it eventually crashes. I cant seem to get any info on what is causing the actual crash. IDoes anyone have any tips on how to find out where the crash is coming from?...

has anyone successfully setup t3 with jest + rtl?

I'm getting a Error: Uncaught [TypeError: Cannot read properties of undefined (reading 'trpcState')] error when I try to setup my next page component.

VSCode wrap with function call snippet/shortcut? Or move cursor to beginning of selection?

Hey all trying to wrap a long array of objects in a function call.. I looked at the 'surround' snippet in VSCode but the only function wrapper they have is to actually declare one, not simply call... Any ideas? Id be happy to do it with selections, but you cant move your cursor to the beginning of a selection (only to the beginning of a line). :~(

MDX Intellisense

Hey, I ran into this when updating the create-t3 docs and now when creating my own docs . Take this screenshot for example, when I bring up auto complete it should show me what props this component needs and yet nothing appears, anyone know of an extension to get this? Thanks!

How to load a build index.js file that requires other modules

I am trying to make a plugin system for my app. Screenshot is the code loading the plugin. The index.js containing the plugin sits in a separate plugins folder (alone). When I try to run require() I get an error that the dependency of my plugin api has not been found(module not found error).

Tailwind breaks on hot-reload

Tech: Tailwind latest version, next.js 12 I realized that my tailwind breaks (aka some classes suddenly have no effect) on hot-reload, and specifically when I shut down my local server, and run it up again. When I have my localhost opened on the browser,...

Next Image

so my css is breaking on the first load if i use the priority in the <Image> ```{shopImg && ( <Image src={shopImg} alt="My Image"...

Deploy Strategy

What do you guys use for your deployment strategy? I bought a virtual private server and I'm trying to figure out the best way to deploy.. I'm leaning towards docker and GitHub actions with nginx

TRPC UseQuery

How can I have a trpc useQuery hook only be called if there is an active logged in session? I understand that you can't use hooks inside conditional statements, and that's why I'm getting the following error. Unhandled Runtime Error Error: Rendered more hooks than during the previous render. Image...

403 Protected TRPC | Vercel Deployment

Hi, i've been running into an odd issue using protected routes with CT3. It seems when I deploy my CT3 app to vercel, all my protected routes throw 403 errors even though i'm authenticated. I'm unsure why this is, and haven't been able to find a solution.

Will next-auth fetch the account information from API every-time I page refreshes or changes?

Or maybe useSession or getServerSession call? If it does how can I prevent this, because I am using discord provider and even with a 1/2 users using the website its getting 429 Ratelimited very often. Code of my auth.ts...

Typescript question

I have code like this but I think my types are wrong because I cant access shape of zod schema on my class, also on comments I have some questions, any idea? I would like to be able to get schema on my database class correctly: ```ts import z, { type Schema } from "zod"; export class Database<T> {...

Getting a possibly undefined after undefined check

Getting really bugged with typescript here - what is going on here? The warning is that the object might possibly be undefined...

Prisma model name preferences

Hello, What do you guys prefer or what is the "right" thing to do? ```prisma...

Is there a good sqlite client for js?

I'm really trying to cope with this one: https://www.npmjs.com/package/sqlite3 but seems like it has been designed to hate you....

Zod File Upload Validation with Open-Api Support?

Hi guys, anyone know how to validate file upload with zod and get also open-api support?