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

TailwindCss typescript error in config

I have a question regarding the implementation of the tailwind.config.js that uses the custom default props and has theme as a prop in the typography specification. How do you make it work in typescript environment? ```...

How to do a WHERE clause for a JSON field in kysely

Basically the title. I'm trying to convert the following prisma query to kysely and can't figure out how to do the individual statements inside the where: ```ts prisma.tournament.findMany({ take: 24,...
Solution:
Hey πŸ‘‹ A built-in type-safe support for json traversal might be introduced in a future release. There's a PR I'm experimenting in. Postgres as always is different 😐 . For now:...

Question regarding tRPC

Hello everyone, I have the following file in src/pages/room/[slug].tsx: ```...

Using T3 for AI agents and similar products

Hello - I'm new to T3 and JS/TS, but I'm a .NET dev working with MAUI and Blazor. Really want to explore T3, but I have some (maybe stupid?) questions. I find it unnecessarily hard/verbose to use AI tools like LangChain and OpenAI APIs in .NET - especially when I can do pretty much anything from chatbots to agents in Python with 10-300 lines max. I love Blazor, but frameworks like Next or Svelte are just so much more performant, better documented, plus Github Copilot is way better here than in .NET/Blazor....

Getting a Alert to Show Up Once When The Component Gets Put On Screen

Hello, I am trying to check a cookie and then show a alert(), though with React 18's mount twice thing I am not sure how I should go about doing this. Could anyone provide some advice? Thanks!...

Tutorial to implement S3 file upload

Hi guys, I’m new to file uploading. Does anyone know a good tutorial on how to implement S3 file upload in React/Nextjs (specially T3 app)? I’m new to this and kind wanna know the best way to handle it rn since uploadthing is still in beta. 😁...

Example repo, NextAuth with App Router

Is there any example repo for NextAuth with App Router? For protecting pages, not /api

Why is the first query on each request so slow?

``` query: 356.14ms query2: 6.166ms query: 51.136ms query2: 4.249ms...

How do you setup Shadcn with Create t3?

Out of the box it does not work, if I try to add Button I get this error:

Tailwind quick question?

Awkward div loads in normally and then shrinks. any ideas? https://recordit.co/6KmKcYsJa3...

Problem using TSyringe

I am trying to use TSyringe for dependency injection, only problem is it doesn't work for my main class. All of my other autoinjectables work just fine, I just need to pass them to my App class. When I try to resolve it using container.resolve(App) I get the following error: ```ts 474 | var paramInfo = typeInfo.get(ctor); 475 | if (!paramInfo || paramInfo.length === 0) { 476 | if (ctor.length === 0) {...

Adding Input Fields on a TRPC Middleware

Hello! I was wondering if there is a way to add input fields onto a TRPC middleware. Essentially I would like a token field to be required on any inputs through the procedure that uses this middleware. How would I go about this? Thanks!...

[Solved] Dynamically generated NavLinks have weird behavior on ISR

I've got a page on https://ambushfall-next13-app.vercel.app/ where I dynamically generate the navlinks under layouts with the following code ```js const reg = /^([^.]+)$/g; const appDirectory = path.join(process.cwd(), '/app');...

Could someone help me with one to many relation in prisma?

I have a cron job that create a list of records from different tables. Those table items need to be linked (have foreign key) with record of tables. Following is my Prisma schema and the cron api.
Solution:
```tsx const savedReportDB = await prisma.reportDatabse.create({ data: { userId, generatedFor: yesterday,...

Next.js 13 get current URL path in Server Component

This may be due to the current beta-phase of Next.js 13 app directory, but I am struggling to make a simple nav link with an active state based on the current path name–only with server components. I assumed that there were an API to get the current pathname, just like you can get headers and cookies in Server Components. But alas, I couldn't find any. I know this is possible to do with Client Components. But I wan't to keep the nav and its links server-side rendered for this example....

app router state management

how do you use redux / zustand in nextjs app router?

need discord bot hosting 24/7 uptime free low specs no card no phone

need discord bot hosting 24/7 uptime free low specs no card no phone

Need to disable ESC to close modal on Vue.js

Hi, I am having some problems with Vue where I have a modal that's not suposed to close when pressing ESC. I tried many ways to solve this but havent been sucessfull in any of them. Would be glad if someone could help me.

Clerk: Getting the OAuth access and/or refresh token of user

The title should say it all. Does Clerk's user interface even include the two?