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

shadcn Dialog - "submit" vs "cancel"

I am working with a shadcn dialog and I want to execute different functionality when different actions happen. Specifically, I have a form in the modal and I have a save button, which I obviously want to make an API call. However, you can also close the modal by clicking on the backdrop and the built in close button. I want to be able to reset my form when I select the backdrop/close button and execute the API call on click of the save button. As far as I know, theres no way to distinguish between the method of closing the Dialog, any ideas?...

Seeking Data engineer/analyst to help me create queries for SQLite DB.

I'm creating a pokedex for the miyoo mini plus. I found a repository of .cvs files containing a lot of information from the pokemon franchise. I'm used these .csv to creat a SQLite DB. I've been able to generate a good amount of queries with the help of chatGPT. But chatGPT has a limit for free accounts on how much data analysis it performs. And it works for simple queries but for the more complex queries I think I'm going to need some assistance. ...

Typescript errors in code

Hi i have a wired issue. In all my typescript projects there is like everything marked as a error. Examples are in the screenshot. I searched the web and tried a lot of things, like updating ts, modifying the tsconfig and eslint config. But the problem appears in all my projects and in cursor and vscode. It runs grate but all these red error are a little bit annoying....
No description

[AdapterError] NextAuth with Drizzle Adapter on Edge

Im trying to guard my application from un-authenticated users. Basically if not authenticated redirect to login deal. I have attached a simplified middleware which i use for this purpose. Along with the error message i get when using it. This error only occurs when i use middleware along with NextAuth....
No description

React Native and StoryBook

have someone used expo with storybook? I am trying to use both of them but keep getting too many errors
Solution:
i am closing it, it seems like an expo issue? Expo still not really compatible with pnpm although it has an option of creating with pnpm. All issue related to pnpm are still open and people still encounter the same problems. Pretty strange that expo doesnt address it anywhere.

question about the "taint" section of the "From 0 to Production" tutorial

Theo described how its important to do your server calls away from components in a file marked with server only. Im following the tutorial but using trpc too, in the setup it seems like the server only functionality is already setup when the cli made the project, because i can see "server-only" imported in the server.ts file and i believe the context is being made here so i shouldnt have to also import it in the file holding my query? But i just wanted to make sure i dont have to also include this in the router file. Relevant code:...

UploadThing Error while following "From 0 to Production" tutorial

While trying to follow Theo's tutorial here: https://www.youtube.com/watch?v=d5x0JCZbAJs Around the 1:00:25 timestamp, while following the UploadThing setup section, I get the error in the image below. I have no idea where it's coming from or how to fix it. I haven't seen any issues brought up about it in the uploadthing Github repo so I'm assuming it's a me issue. I'm not sure what I did wrong, since I've been following the tutorial very closely. ...
Solution:
resolved! The issue was not making the component that used the UploadButton component a client component.
No description

credential login with NextAuth

guys i have been dealing with some errors while adding credential login to my project. I am adding the screenshot . I would appreciate any help.
No description

setState mutating initialized object

Hey all swiss cheese question here. I have two states, a current state, and a revertable state which are both initiated by the same object: ```tsx const mockData = {...

Postgres not available on Vercel

Hi, im following the tutorial on Theo's The Modern React Tutorial However on the setting up database part of the video, i realise that vercel doesnt have postgresql anymore? any help?

postgres node modules not found

I'm running into this error after I added an AuthButton component, i followed this tutorial to create the button https://www.youtube.com/watch?v=z2A9P1Zg1WM&t=485s I'm using create t3 with nextauth and connected to neon postgres db with drizzle AuthButton.server.tsx...
No description

UploadThing invalid secret error, invalid server config

Hi I'm using the UTapi and it stopped working with the new sdk API keys not sure what's going on this project uses Astro any help is appreciated thanks!...

Help me with OAuthAccountNotLinked

i cannot get this error fixed
[auth][error] OAuthAccountNotLinked: Another account already exists with the same e-mail address. Read more at https://errors.authjs.dev#oauthaccountnotlinked
[auth][error] OAuthAccountNotLinked: Another account already exists with the same e-mail address. Read more at https://errors.authjs.dev#oauthaccountnotlinked
https://github.com/Parthvsquare/hsco-t3-turbo...

RSC error

loading a server component gives me this error ```js import { Button } from "@/components/ui/button"; import { getServerAuthSession } from "@/server/auth"; import { Rocket } from "lucide-react";...

Am I missing the point of using `use` for data fetching with server components?

In the react docs, they give the following example for how to use the use function: ```tsx // page.tsx import { fetchMessage } from './lib'; import { Message } from './message';...

How to send metadata from client to server via useUploadThing (Nuxt3)

I've been using uploadthing in nuxt3 for a week. Most things work, but I can't pass metadata from client-to-server via useUploadThing. What I'm trying to do: create a customId on the client, pass it to my server, and use it to form the presigned URL. Starting on the client with: const {startUpload} = useUploadThing("images");...

onUploadComplete callback fails

Hey All, Setting up uploadthing in a fresh next app router app. Running next dev server using bun run dev....

Is t3dotgg/yerba the best way to use electron in a monorepo?

Hello, I have came across a lot of templates that implement an electron app in a turborepo, and t3dotgg/yerba was one them. What I noticed is the lack of issues and maintenance on the templates so I thought I should ask if it's still good to use it or are there any better ways to have an electron app in a turborepo/monorepo project....

How does bun install work ?

When I install this package using bun add, I noticed that bun also installed hono and other pacakges (devdeps) but ig it shouldnt have done that ?
Next