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

API Patching Strategy

For patches on objects that update single fields, is it better to push each patch to its own route or have one route for all patches? Say you have a simple object ``` color...

Expose API endpoints to other apps

If I built an app with the t3 stack, how can I expose my api so other apps can use my auth logic or

Issue with T3turbo - Terminal Scroll to bottom and Not being able to select text

I have an issue with myt3turbo project. firstly the terminal does not automatically scroll to the bottom, meaning when i want to debug i have to manually do it everytime. Secondly, I am unable to copy paste any text from the terminal. ...

'Invalid response or stream interrupted' when using T3+TRPC with Clerk

Hello, I've encountered strange error when trying to use trpc's useSuspenseQuery while having clerk authentication implemented. When I try to call useSuspenseQuery, I get Invalid response or stream interrupted error. On client I get Uncaught Switched to client rendering because the server rendering errored. The full terminal output can be seen in this Github Gist. As I was putting together minimal reproducible example, I found out that this doesn't occur without Clerk. This led me to suspect it has something to do with Clerk's middleware, but I have no idea how to even start to debug this....

Loading server components on the client

Have anyone tried loading server components in the client. Maybe something like this: ```typescript <ServerComponentLoader ...

enter my secret, client id, error says that table dosnt exist

What db url should i use? Im trying to add login with discord, i enter in all the correct info And it just either says that the DB isn’t found, It then errors that “users” table us there,,,, when it is, ...

Theo Thermomix website

I hope I don't get banned for this. Lately, I think on stream, not in a video, Theo visited and showed a thermomix recipe website. And I cannot find it anywhere. But I don't think it was the official https://thermomix.com ...

Websocket advice nextjs-nestjs

Hi everyone, I'm currently working on a Point of Sale (POS) web app that is primarily used on Samsung tablets with a special browser called Star WebPRNT. This browser is required for receipt printing functionality. Recently, I started developing a QR code scanning feature to scan vouchers and apply discounts for customers. The feature works perfectly on Chrome, but unfortunately, it doesn't work in the Star WebPRNT browser, which is quite frustrating....

T3app discord login, what does this mean? “discord invalid oauth2 redirect_uri”

What variable do i use for the callback url? “discord invalid oauth2 redirect_uri” is the error i get when i log in. I created multiple routes, ...

error after discord login “try another account”

I created a app, got my client id and secret, I added the call back url What am I missing? ...

Why does THeo hate on DigitalOcean?

I couldn't not notice in Theo's video about the StackOverflow survey mentioning that people should stop using DigitalOcean, or at least not learn on it. Anyone have any more details about this, or things he said? Because I've found DigitalOcean to be quite cheaper even if they do not have all the possible services like AWS does....

T3 App type error

Hi guys, I just tried creating a new t3 app and I selected next-auth and drizzle. How can I fix this type error? TIA Type 'PgTableWithColumns<{ name: "user"; schema: undefined; columns: { id: PgColumn<{ name: "id"; tableName: "user"; dataType: "string"; columnType: "PgVarchar"; data: string; driverParam: string; notNull: true; hasDefault: true; enumValues: [...]; baseColumn: never; }, {}, {}>; name: PgColumn<...>; email: PgColumn<...>; ...' is not assignable to type 'DefaultPostgresUsersTable'. Type 'PgTableWithColumns<{ name: "user"; schema: undefined; columns: { id: PgColumn<{ name: "id"; tableName: "user"; dataType: "string"; columnType: "PgVarchar"; data: string; driverParam: string; notNull: true; hasDefault: true; enumValues: [...]; baseColumn: never; }, {}, {}>; name: PgColumn<...>; email: PgColumn<...>; ...' is not assignable to type 'PgTable<{ name: string; columns: { id: DefaultPostgresColumn<{ columnType: "PgVarchar" | "PgText" | "PgUUID"; isPrimaryKey: true; data: string; notNull: true; dataType: "string"; }>; name: DefaultPostgresColumn<...>; email: DefaultPostgresColumn<...>; emailVerified: DefaultPostgresColumn<...>; image: DefaultPostgres...'....
Solution:
nah, wans't really referring to t3 hahahaa. Its just an expression out of frustration. I did some research and I think my problem isn't caused by t3 at all, its because of the adapter just not having the right type.
No description

No typescript error. Why?

Hey, all you tech geeks out there. can someone explain to me why I didn't get ts error in this case? here's a link to the file that confused me: https://github.com/mbozhik/spiller/blob/main/src/components/app/products/Catalog.tsx...
Solution:
Would it be fixed if you remove [x: string]: any?

Onclick() on uploadthing

is there any way that when i upload the image, it wait for a onclick() and then uploads to the uploadthing database? cause it's annoying when you realize that you made worong uplaod
Solution:
https://docs.uploadthing.com/api-reference/react#useuploadthing Here are the docs for it with an example of using a plain old html file input, and you can then implement your own component...

tRPC react-query TypeError

Hi. I'm getting a strange error in trpc/server.ts line 27 (screenshot 2). The error comes from @tprc/react-query/rsc. Should this happen? From what I understand from the internal code of rsc, if AnyRouter extends TRouter, caller should be of type TypeError, else caller should be of type Caller<TRouter>. Shouldn't it be the other way around? I couldn't find anything useful in react-query docs. I'm using the App Router....
Solution:
SOLVED (not really, but let's say it is): Resetting TS and ESLint didn't work, but apparently closing VSCode and opening it again did.
No description

Nextauth drizzle adapter type errors

When i initialized t3 app with drizzle and nextauth, i got those type errors in DrizzleAdapter
No description

ERROR: o [TRPCClientError]: Invalid response or stream interrupted

Recently kicked off a new project from create-t3-app. I made one update to use neon db on the db/schema and sent up my first commit/innit. The project deployed and I was able to create a new post and view the latest post with no issues. For my second commit I wanted to remove most of the boilerplate t3 setup. You can see this in the image I attached for my PR. ...
No description

Lucia Auth Question

I have been having some trouble setting up a deep link redirect callback for Lucia Auth, does anyone have any examples or help they could provide? My setup is just the basic lucia auth setup with the email/password login. Nothing has been changed. https://gist.github.com/cnbrown04/ba61a256dcbc23122b99ea0964567fe1

Issues with attaching `customId` to Files using `utapi.uploadFiles()`

Hey all! I'm using uploadthing server side via the utapi library but when i try to attach a customId to a file object and upload I error out vs just uploading w/ no customId. This is the code...