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

next auth with planetscale?

currently following https://www.youtube.com/watch?v=YkOSUVzOAA4 , but when i add relationMode = "prisma". it tells me
With `relationMode = "prisma"`, no foreign keys are used, so relation fields will not benefit from the index usually created by the relational database under the hood. This can lead to poor performance when querying these fields. We recommend adding an index manually. Learn more at https://pris.ly/d/relation-mode-prisma-indexes"
With `relationMode = "prisma"`, no foreign keys are used, so relation fields will not benefit from the index usually created by the relational database under the hood. This can lead to poor performance when querying these fields. We recommend adding an index manually. Learn more at https://pris.ly/d/relation-mode-prisma-indexes"
for the models necessary for next auth, so...

Why use Turborepo over Nx

In general or/and for Next.js specifically. I've seen Theo talk about Turbo but when I tried it, it was painful because of all the ESLint errors in the default repo it created. Nx is way richer in tools and benchmarks show that it's faster than Turbo, although I'm not sure if that's still the case. What benefits Turbo has other than being simpler for smaller projects?

when to use tRPC vs a nextjs api route

ive really started to appreciate the tRPC-prisma data flow to my frontend, but im coming from a nextjs-not-typescript background. ive been using api routes there forever, and i still see it in the ct3a directory. but when do i use it then?

Strange Runtime Error

Hey guys, it's the first time for me using the T3 stack i'm trying to create a note-crud just to test with the stack but this error has left me stuck on it for a while. ps : sorry for my english and I'm a french speaker from Belgium

VSCODE styling

Watching Theos most recent tutorial. How do I get my prisma file styling to look like his: I may be missing a suggested extension?...

Sending file (image/video) to trpc procedure

Hi anyone have a clue on how i can send an image/video to trpc procedure to upload it to google drive from there i tried to do it directly from front but since i need access to fs i couldnt if you have another way to save a video to google drive in nextjs i would love to know it...

Consuming a tRPC Query in getServerSideProps

Hey! Building a link shortener for practice using the full create-t3-app stack. Running into an issue consuming a tRPC query in a dynamic page during getServerSideProps. Attached is the error. As far as I can tell, my createTRPCNext config is configured correctly. Here it is:...

Is my Stripe code correct?

Hi, I want to offer my users a fixed-term subscription plan, where they get 30 days for free, and then they pay monthly for 12 months. Am I doing this the correct way? (I am not using a webhook since it gives me errors and I have up) Creating a session ```...

When should I not use tRPC

Hi, I'm fairly new to using tRPC, and was wondering what are some situations that would benefit to having a dedicated server to handle those tasks rather than tRPC to handle those scenarios. The only major thing I can think of is Websockets

SignIn discord user if he is on a certain Server

Hi im wondering if there is a way in NextAuth to sign user only if they are on a specific server otherswise redirect them to signin page

How to skip batching for a single trpc query in trpc v10?

I want to skip batching for only one query. But I am not able to figure out how to do that. As in the trpc v 10 docs I can see that we can completely skip batching, but I can't figure out how to skip batching for a single query. In trpc v9 we can do it like this const postsQuery = trpc.useQuery(['posts'], {...

combining prisma migration files

I've over 20 files of migrations in my codebase. Is there any way i can combine those into one in t3 environment.

Scalar lists but on Planetscale?

After starting to watch the tutorial posted day, I bit the bullet and am going to give planetscale a try! I use 2 scalar lists in my current setup to store an array of tags for posts. These don't work on planetscale. Database experts (or simply not a noob like me!) What is the best alternative to use?...

Handling OAuth Login Errors with Dynamically Generated URLs in Vercel Deployments

I'm encountering an error when trying to log in with OAuth on my website. The error message indicates the specific URL I need to add to the redirect list. However, this URL is dynamically generated as a website preview by Vercel. Is there a method to ensure that this, as well as future deployments and branches with different URLs, will work automatically? Wildcard will not work:...

Prisma p.account.create() error "Column: for"

When I sign in with discord, it works fine, when I sign in with spotify, I get this error: "The provided value for the column is too long for the column's type. Column: for" I dont have a column "for" in my schema. Prisma creates a new user table, but cant create an account for the user. ...

tRPC Error handling

im trying to understand how tRPC handle 400 errors request what i got so far is im doing this in my procedure
if (exam) throw new TRPCError({ code: "BAD_REQUEST" });
if (exam) throw new TRPCError({ code: "BAD_REQUEST" });
...

❌ tRPC failed on partition.getAll: UNAUTHORIZED

Hello gentle-men/waman, i have been struggling with implementing a custom credential provider the last two days.. haven't slept properly.. and now i must admit i need assistance. I have successfully implemented the "login/nextauth" part of the job, in the client side.. but when i call my queries from client i get ❌ tRPC failed on partition.getAll: UNAUTHORIZED .. I think the solution is that i somehow get my session from useSession() send to TRCP or auth by TRCP, but i dont know... thats what been bugging me the last 48 hours.. please some kind soul.. HELP MEE 🤯 P.S it think has something to do with the way the protected procedure autheticates a user. P.P.S if you need any futher information. Please dont hesitate to ask me. Thanks in advance!!...

Airtable OAUTH using NextAuth

been stuck for this for last 5 hours pain i want to use airtable through oauth in my app and fetch data this is the link to airtable oauth docs: https://airtable.com/developers/web/guides/oauth-integrations ...

Astro Zod environment variable validation

How can I implement the same pattern T3 app uses in env.mjs uses in Astro?