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

Using table prefixes in drizzle multi-project schema with NextAuth.

I'm using a setup that allows for schemas of different projects in one database, the default drizzle setup with T3. Using ``` "@auth/drizzle-adapter": "^1.1.0",...
Solution:
totally my bad, it's covered in https://authjs.dev/getting-started/adapters/drizzle if anyone has this issue in the future. just needed to pass the tables object with the correct assignments.

Client side Upload button disabling

one more question. In my form, i need "selectedCategory" to be selected. It is a useState which is either undefined or has a category value. Is there a way I can disable the upload button if that state variable is undefined (user must have category selected)? Thanks! I did this in core.ts if(selectedCategory === "") throw new UploadThingError("Need a category to be selected") But can i do this client-side too?...

expo app production logging solutions

Hey, What are the axiom (logging) sentry.io (error logging) equivalents for expo apps?

Modern React Tutorial Error

Hi, I'm following this tutorial but am running into the following error at the 11-12 min mark. How do I fix this? https://www.youtube.com/watch?v=d5x0JCZbAJs...
No description

t3-stack in figma plugin?

I want to use the t3-stack to write my figma plugin UI but I am struggling to use the trpc client. I am getting a ``` from origin 'null' has been blocked by CORS policy...

auth.js v5 or 'NextAuth'

is auth.js v5 available on t3 stack or is it still the previous version 'NextAuth'

Scaling page with respect to viewport width

Is there a way to scale a web page completely with respect to viewport width? All components should have the same aspect ratio. I was thinking this has something to do with the <meta name="viewport" but not sure....
Solution:
afaik there is no way to make your entire website scale according viewport size, otherthan using viewport units on each element: https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Sizing_items_in_CSS#viewport_units aspect ratio might also be useful there https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio...

DrizzleOrm schema requires an id

I am having an issue with inserting a new user to my users table, because I need to pass the id unlike in prisma. Any ideas how I can kind of "skip" this part or just dynamically create it?...

select vs query? (Drizzle)

I am building my first production application with Drizzle and I am loving it. But one thing that is not clear to is when to use query vs select. Are there performance implications and I want to know the differences in behavior.

T3 trpc depdent query is failing ?

I have this code , my third question getQuestion useQuery is failing not sure why, I read about from online but adding enabled did not solve it, the error is TypeError: Cannot read properties of undefined (reading 'length'), can anyone help me on this ? ```js const event = api.slido.getSlido.useQuery({ id: eventId });...

Uploadthing multiple upload files

I have 1 feature, where users can upload as many files as they want, how can I upload as many files as possible, without having any limits? If I omit maxFileCount, I can only upload 1 file, is there a way? If there is no way, maybe the solution is to make maxFileCount be 99999 or more...

generateUploadButton button is disabled or something

I made a temp react app to test uploadthing, I just did ``` const UploadButton = generateUploadButton({ url: "localhost:6060/cdn/api/uploadthing"...
No description

Pings videocall built some thing like webrtc?

Hello guys, i was wondering the videocall of ping wqs built with something like webrtc. If yes how aref they achieving such a high quality. If not, what else they might using?

Can you store refs in an object in React?

In a component we need 9 different refs (don't ask 🙂 ). If we put the refs in an object like this will they be referentially stable? I fear on every render the object will be reevluated, but using an object just makes it a bit cleaner. ```const refs = { contextChildrenActive: useRef(null), primaryNavBar: useRef(null),...

Advices for an electron app

Hello guys, I have some conceptions issues with electron, Sometimes, my app will be on non connected computer, sometimes, will be connected. My issue is: for non connected, I have to store the data somewhere, I decided on litesql But, for the connnected computer, I have 2 choices:...

uploadthing cant use generateReactHelpers to get the uploadFiles function

idk seems off. when calling upload file like in the code i get the error in the screenshot. also there is a screenshot of how i am trying to use genereateReactHelpers
No description

Why am i unable to upload it?

```ts import { generateUploadButton, generateUploadDropzone, } from "@uploadthing/react";...
No description

Next Auth - Apple sign in - Pages router

Someone here that has done apple auth sign in for next auth with next.js pages router? 🤔 Not sure what I am missing but I am getting "invalid_request Invalid client id or web redirect url"...

Writing to a variable defined outside a component or hook is not allowed. Consider using an effect

With the new react compiler, I have a few Writing to a variable defined outside a component or hook is not allowed. Consider using an effect an example of something triggering this is ```ts const onSomeEvent = () => { document.body.style.overflow = showMobileFilters ? "auto" : "hidden";...

Send extra info (student id) to upload functionality

I have this client component: ```javascript "use client"; ...