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

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...

Need some help with setting up Express with Next

I'm trying to use Express with Next but it's not working I'm getting this `` [nodemon] starting ts-node --project tsconfig.server.json src/server.ts -- -I` C:\Users\Aditya\AppData\Local\pnpm\global\5.pnpm\[email protected]_@[email protected][email protected]\node_modules\ts-node\src\index.ts:859 return new TSError(diagnosticText, diagnosticCodes, diagnostics);...
No description

Runtime error on redirect post-deletion

Following the From 0 to Production - The Modern React Tutorial (RSCs, Next.js, Shadui, Drizzle, TS and more) Tutorial here https://www.youtube.com/watch?v=d5x0JCZbAJs I have successfully made it to the delete button. When I click the delete button, I get a Runtime error and it crashes. When I add a 5 second delay before the redirect("/"); occurs and escape the full page image view before the redirect, there is no error. In both cases, the deletion of the image is successful. Could someone point me in the right direction towards troubleshooting this please and thank you!...

how do i find the html or php file?

i use Stellar hosting and the main website builder i want to move everything away from that and learn how to make my own website and learn this is what i have so far its simple and dose what it needs to but it dose not look good enough and i want to know how to find the html or php file i can directly edit

vercel (other) as game server

Hey, I need a game server for my billiard game (which would just be SPA) that supports web sockets. The plan is to offload traffic (syncing state between two players) to WebRTC if possible and use this server for signaling in WebRTC or as a fallback if WebRTC doesn't work. I was thinking of using Vercel for this, but I would prefer to write the server in "Go" to learn something new. This will most likely be partially open source. Do you have some suggestions? Thanks in advance...

recommended pattern for sharing data from same api across multiple client components using approuter

after reading https://nextjs.org/docs/app/building-your-application/data-fetching/patterns and https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#sharing-data-between-components, I feel like I'm seeing two contradictory recommendations. I initially would fetch data from a server component that would pass down the data two its two child client components and found that the json data, even though parsed in the server component shows up in the client components as strings, which means that I'd have to parse it yet again in the client components. then I see that it might be discouraged to follow this pattern according to the second link and instead use nextjs's fetch, which may lead to something like this ```...

T3 Env accessing VERCEL_URL on client side

Hello, I've been working on making sure that our .env variables are typesafe when I came across T3 Env. I tried it out and managed to create a env object replicating my .env.local file. Here's env.ts ```ts...
No description

NextJS `useOptimistic` vs. tRPC react-query optimistic update?

I'm using 1. NextJS app router 2. tRPC with react-query I want to perform optimistic updates but I'm unsure which approach to use? I followed NextJS example first. The state updated correctly but jumped back to the initial one. Then I followed t3 documentation but I'm not sure if that is using pages or app router....

useQuery in NextJS app router client components

I have started a project using create t3 app and app router and noticed that in the template application I can no longer use: api.tableName.functionName.useQuery() (see attached image of T3 app router vs non-app router homepage templates). I realise in the T3 app router example, the index page is a server component so it doesn't need useQuery, but I was planning on having a client component that are 2 tabs with different content for each tab (see attached image). Here are some requirements:...
Solution:
You’re importing the server stuff, need to import from ~/trpc/react instead
No description

unstable_cache behavior in dev mode?

Anyone knows if I should expect unstable_cache to always miss the cache in dev mode? Seems like that's the default behaviour, but I may be mistakenly invalidating it.

upload on onClick()

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:
hmm

Handling Third-party lib client component that relies on ENV vars.

Hi, I am currently trying to add search on my project, and I stubbled upon a common scenario that I don't know how to handle yet... I am trying to use Meilisearch with react-instantsearch library....

Tree shaking object based API SDK

Hey guys, I use this internal sdk I built all the time, it works great but Im trying to get it treehsaken correctly. Heres a small snippet of what it looks like ```ts...

is using clerk w/react native worth it?

im using expo w/react native, this means that i cant use clerk's prebuilt components or account portal, and need to make a custom ui anyway, so are there any features that clerk offers, that supabase doesnt? (since im using it for the db anyway)

<img /> flicker on transition when conditionally rendering separate lists

Wondering if any highly knowledgable react people might be able to help me with this problem- i don't really have any idea for a fix i have an array of data that i render. this array, however, can be either read-only, or editable, depending on whether it is the user's own page or if it's another user's page (image 1) option a) is to embed all of the editing logic (mostly just sorting with drag and drop) inside of some sort of List component, and then pass a boolean to the List component which decides to render the editable ui or the read-only ui. this works perfectly fine...
No description

Protected Procedure Not working even when logged in (on server side)

I have a tRPC procedure using protectedProcedure, but it's throwing an error when I'm calling it using apiServer[pic 1] and being clearly logged in.
No description