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

Extension loader pattern only recognizes ext2 instead of ext1 and 2

Hey, can someone help? posted the question on stack overflow as well, but I am hard stuck stuck, this is the code: ``` interface ExtensionArgs { name: string; }...

Best NextJS Logging Stack?

Hey guys so I am working on a NextJS eCommerce application and I also have other apps I have in prod and I am not happy with how I am handling logging. A big feature I want is one that easily allows local logs as well that way I can filter by environment and see whats going on. Looking for a solution that can handle large environments with multiple environments / branches...

help with aws s3 writable streams

hey, I've been trying out working with R2 and aws sdk V3, this is the approach I'm performing to write some code files stored in R2, I know it does not work every time, and Static type checking does not help me much here. Any help is appreciated. But remember that I've never worked with R2 before and don't know much about aws s3 . thank you for your help.

What's the best way of making a Next.js image component fit the parent size?

```html <Image src="/images/other-img-1.jpg" alt="Server image" width={0}...
Solution:
Use fill property

Https Queues... Is Zeplo.io active?

So we are using vercel and we are having the following problem: 1) We receive a lot of webhooks from multiple services (No problem for Vercel) 2) Some of those Webhooks should be inserted into our DB (Using Neon, again no problem yet) 3) Some webhooks depend on the previous step for example: if a new "order" is created we get a webhook and if a shipping method is updated we get another webhook (from the same order). The PROBLEM starts here, when we get both of this webhooks too close to each other like 50ms distance from each other and the DB insertion is not finished so the second webhooks fails or we end up duplicating the creation of an order that should actually be unique....

Why is there no .query() in my trpc procedure

How is this possible? It says
Property 'query' does not exist on type 'DecorateProcedure<{ ctx: { headers: Headers; db: PrismaClient<{ log: ("query" | "warn" | "error")[]; }, never, DefaultArgs>; session: Session | null; }; meta: object; errorShape: { ...; }; transformer: true; }, MutationProcedure<...>>'.ts(2339)
Property 'query' does not exist on type 'DecorateProcedure<{ ctx: { headers: Headers; db: PrismaClient<{ log: ("query" | "warn" | "error")[]; }, never, DefaultArgs>; session: Session | null; }; meta: object; errorShape: { ...; }; transformer: true; }, MutationProcedure<...>>'.ts(2339)
...
No description

Weird errors when using useQuery

Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
```ts 'use client'; ...

Free VPS for students

Hi, I was wondering if you know of any free VPS hosting options for students. I'm not really a fan of Linode since their offer is only for two months with $100 in credits, but I need a VPS for around three months. The server doesn't need to be super powerful—just enough to host a PostgreSQL database and a Next.js site.

Resizing, snapping and drag and drop

If you were to build something like the clip below, what would you use, if any library at all? I was at first thinking of building it myself but there are quite a few edge cases so thought it might be worth looking at a library. I've used dnd-kit for most of the drag and drop but it doesn't have resizing. Any recs for React?...

How to combine multiple backend projects that have different tech stack

Hello fellow developers o/ I have an interesting situation. I have a nextjs website that requires 2 external backing projects to fulfil its functionality needs. The backend projects are written in express and springboot respectively....

headers: heads vs. CreateNextContextOptions

Howdy, I've been following this nifty video on YouTube: https://youtu.be/YkOSUVzOAA4?si=_D4dZp4vBHzIJFXK It may be a bit dated, as the code in the video isn't lining up with the code in the repo link. Right around 1:23, Theo goes into how to use Clerk to effectively prevent access to tRPC procedures, using a private procedure that invokes some enforceAuth middleware. My question is that opts here wouldn't work:...

How to add swagger to hono api

I want to add a swagger doc to my API and when I add middleware to any new OpenAPIHono instance the ".openapi" method disappears. ```ts /** * Creates a base instance of Hono with middleware. * @returns {Hono} The base instance of Hono....
Solution:
turns out you have to break it up and it works ```ts const base = () => { const router= new OpenAPIHono() router.use(databaseMiddleware)...

Drizzle turso configuration not working

Hi! No matter what i change in my schema, i get errors. Only if i drop all tables. i can successfully push again. Even just simple changes to schema doesn't work....

How to setup api service for selling with nextjs t3?

Anyone know of a good t3 or t3 turbo template/project that shows you how to setup an API service that you sell. Like fal.ai / together.ai. Kind of setup. I just wanna spin up a bunch of serverless llm endpoints and then charge people to use them.

Does anyone know why my animate-pulse is behaving weird?

In the tailwind example https://tailwindcss.com/docs/animation#pulse, it looks like the colors are just fading in and out. But when I try to do it, it seems that the div is just scaling up and down. Does anyone know why?

Sending emails from a NextJS app

Hey, I'm trying to send an email to myself using a form on my website - the user fills in the information and the email should end up in my own inbox. I expected tRPC would be the correct way to do this, but I'm not able to get anything through to myself. I also tried a server actions approach, but didn't get anywhere there either, as seen in second screenshot....
No description

No response from Uploadthing server

I created my own upload component and get response undefined when using startUpload . Please help. It was working early but when update upload thing to 7.0.2 it doesn't work any more

ERROR LOADING FONTS ON ANDROID

I’m having an issue displaying a certain type of font on android. Probably because I’m using the PostScript naming format. Pls help me
No description

Weird React Behaviour, lost on how to debug

Hey guys, I've been losing hair over this and am a bit lost, hoping someone can help. I have this modal component which I can call, await and get a value from:...

Implementation of clerk at latest version of t3-stack

I've been struggling to implement Clerk with tRPC using the latest version of the T3 Stack. Has anyone successfully done this, or can share some guidance?