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

React Query data can be undefined

Hello, any idea how could i make it so i know my data is not undefined when doing like this using react-query: ```ts const queries = { query1: useGetSomething(),...

i think someone somewhere is applying a font without me knowing, and i cant change it

so backstory app router kinda annoyinh so i searched online and apperantly u can have both pages router and app router i added that and moved the reactive / client routes there and still keep my static components in the app router but when i moved it i notice fonts started changing. i check the styles tab theres no times new roman only when i check the computed tab times new roman appears...
No description

Theo VS Code font

Hi, I'm just curious about the font used for Theo. Does anyone know what it is? P.S. I will delete this question after I get the answer....

"Can't resolve '@node-rs/argon2-wasm32-wasi'" when i tried to add hash logic to auth

I created with t3 stack turbo from julius add i need to add cridential provider to auth packages and it will have hash logic to check password. i using @node-rs/argon2 for verify that after i imported and testing it show this error so. is it have any example of t3 stack turbo with cridentials user name password project to learn that?
No description

Signing Out from client side - not removing session from DB

I'm using the create-t3-turbo mono repo When I use the server side sign in/out button I can see the session is correctly removed from the DB, yay! When I try and create a client side button to signOut it doesn't remove the session from the db, sad 😦...

uploadthing in node14

I'm trying to use this lib in a node v14.21.3 server that does not support the nullish coalescing assignment operator (This operator was introduced in ECMAScript 2021 and is only natively supported in Node.js versions 15.0.0 and later) What could be an elegant solution to this?

Vercel Usage, DDoS & Cloudflare (a fun topic i know)

So me any my co-dev just released our new project which is a web app for listing your discord server. Now we didn't naively think this was going to be the CHEAPEST operation, as with any serverless UGC app we knew costs would scale. What we didn't anticipate was (potential) DDoS attacks within the first week....
No description

ERROR!UPLOAD FILE

When I'm uploading a file , it shows an error : ERROR handleUploadAcrion Failed to register metadata But in my dashboard, file is successfully uploaded. How to fix this ?...

Where do I set up the "UPLOADTHING_SECRET" Key ?

I'm using express, as per the documentation, I go through each step, and all is done. Already generate the secret key and make .env.local file. But I'm confused with that. I also check the example https://github.com/pingdotgg/uploadthing/blob/main/examples/backend-adapters/server/src/express.ts Can anyone answer this for me?...

SSG with tRPC

Hi! I want to render the posts index page using SSG, and it should not be revalidated until the next build or deployment. I’m using the T3 stack with the app router and tRPC. I tried wrapping getPosts with unstable_cache, but encountered the following error: ```...

Transform/map source object to target object with schema/map

I am looking for a robust way of mapping API fields to UI fields in a sense of something like DTOs but that doesn’t require much boilerplate code.
I have found what I think a great library that would fit my need but unfortunately it’s not longer maintained https://www.npmjs.com/package/morphism so can’t use it as is in newer projects so I wonder about making a copy of it or trying to do something similar as I can’t find anything else with such functionalities. I wonder if something similar could be achieved with use of zod and its transform option. Anyone aware of similar libs? Would zod fit in this case? The thing with zod that bother me is after failed parsing I only get the error and the part of successfully parsed input is lost. Or does zod support returning error alongside already parsed data?...

Created a fresh new T3 app and I get a warning in browser's console:

Warning: Extra attributes from the server: __processed_ac94e20c-8dfe-49f3-8fbe-cbc1b55b32b6__,bis_register
No description

T3 Stack for Large-Scale Project: Pros and Cons?

Would you prefer using a T3 app for a full-stack project with numerous tables and numerous CRUD operations? As you know, T3 has a monorepo architecture. I've read some things about monorepos slowing down the TS server as they grow. I'm using Drizzle and exporting select and insert types for each table. I'm also creating Zod schemas for all endpoints and inferring and exporting types for all these schemas. Since I'm at the beginning of the project, I welcome any suggestions you might have....

Static IP in cloudflare worker

I trying to hit an external API through cloudflare worker my issue is they require static IP which I have to give So they can unblock me. But cloudflare have dynamic IP Is there any workearound Static IP is only for enterprises...

Can you deploy nodejs functions to different regions on Vercel?

Does anyone here know if it is possible to deploy nodejs functions to different regions on Vercel? (In the same project) I've this read this help doc that seems to suggest it is https://vercel.com/docs/functions/configuring-functions/region#project-configuration But if I add regions array to my vercel.json the build fails...
Solution:
I have just found the answer:

snipping co-ordinates from images in react

are there any abstractions / libraries for this functionality that any of you guys have worked with by any chance? trying to see if its possible without building something from scratch flow: 1. user uploads images...
No description

Using getInfiniteData() for infinite scrolling

Can anyone please help me with this? I can't seem to be able to use these helper methods like cancel(), getInfiniteData(), or setInfiniteData(). https://trpc.io/docs/client/react/useInfiniteQuery...

Errors when I follow the UploadThing docs for "Vue with Nuxt"

I am trying to use UploadThing with my Nuxt project and am getting errors when I launch my app. Errors in the logs when I run the Nuxt app: ```sh timestamp=2024-09-19T22:59:33.226Z level=ERROR fiber=#11 message="Invalid log level" error="{...
Solution:
```export default defineNuxtConfig({ devtools: { enabled: true }, modules: ["@uploadthing/nuxt"], compatibilityDate: "2024-07-26", + uploadthing: {...

ERROR handleCallbackRequest Failed to register callback result

I've integrated UploadThing in my platform. The client is a NextJS application and the server is a cluster of NestJS microservices. The issue is that after a successful file upload (on UploadThing the file is present), the onUploadComplete callback is not executed, thus not finishing the upload correctly on the client, because I'm getting: ```js...
Solution:
hey - that error you're getting is probably cause you're returning a string from onUploadComplete. We expect the return to be an object. I've submitted a patch that will type-error when returning primitive values so this will become a compile-time error instead of a surfacing first at runtime https://github.com/pingdotgg/uploadthing/pull/968