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

NextJS serverless limits

Hey guys, Is there anyway to increase this maximum limit? I need to upload significantly larger files. If not, do I change my route to not be a serverless function? I'm using the edge function as a proxy to upload the image for a different service and don't want to store it in a bucket or anything....

How would you check if a user is signed in for multiple endpoints.

With nextauth how could you check if a user is signed in without having to repeat the code for every endpoint. Apparently middleware when used in database session storage mode doesn't have this ability....

Prisma Schema

Hello doing feedback app, i am having problems to update my feedback info, i want to update name and questions. On comments i show schema and current route....

Build command uncovers typechecking errors not shown by intellisense

Has anyone run into this? Not sure even how to start debugging Looks like my tsserver is running fine...

Build a custom provider component nextjs appdir

Hello. I want to make a react component which when passes as a parent to another, the child will automatically have a certain prop I want to pass. e.g The ProvideAuth component ``` <ProvideAuth>...

Error importing @planetscale/database

I am trying to setup my drizzle orm, but I am having an issue with the "@planetscale/database" module. Heres the error message: ``` Error: require() of ES Module C:<PATH>\node_modules@planetscale\database\dist\index.js from C:<PATH>\db\connect.ts not supported....

Linting errors when building on Vercel that I'm not getting on local machine

Hi all, My build on Vercel is failing because of linting errors. The weird thing is, I'm not getting these errors when building locally at all. This is an excerpt from the build error I'm getting on Vercel: ```...

how to fix typescript error

I have this code: ``` async function updateMysql({config}: {config: { name: string; }}) {}...

What would the best approach be to have a website that can be translated for different countries?

I have a site that is gaining some traction from all over the globe, right now all my text content is english. How would I ensure its translatable for all users?

Simplest useInfiniteQuery implementation?

I'm trying to enable useInfiniteQuery on a tRPC query. I saw several tutorials, but it looked very different every time. My current setup looks something like: ```ts vendors: protectedProcedure...
Solution:
I got it to work! ```ts vendors: protectedProcedure .input(z.object({ take: z.number().default(10),...

When to use useUploadThing and uploadFiles hooks?

Is this only for building your own customizable component instead of the Drag and Drop and Button components that are included in the docs? What are the use cases for these hooks? More examples in the docs would be greatly appreciated!

Prisma client extensions in T3 app

T3 app uses this variable called globalThis and globalForPrisma. I don't understand the usage of it, but it nullifies the extended types. Can I just remove these and use new PrismaClient()? If not, what else can I do? - The file in question: src/server/db.ts - The page for client extensions: https://www.prisma.io/docs/concepts/components/prisma-client/client-extensions/result...

t3 monorepo with fastify backend

Greetings! I’ve enjoyed building with the t3 stack for over a year and scaled a platform to production without any need for a server. Now I am running against the limits with vercels function timeouts, e.g. when using transcription APIs that need minutes to respond, complex llm calls with langchain etc. ...

Prisma

Hello everyone. I have started working on an app with the t3 setup. The app is hopefully going to grow and I was thinking maybe there is a way to have multiple Prisma schema files and then stitch them together in one file rather than having everything consolidated in one massive file. I would love to hear your thoughts. Thanks!...

Continuous process while server is running

With NextJs my definition of a server is being challenged. I see a server as a program that can serve requests and do background tasks. With nextjs it seems to only do the former. I have a web application where users can manage instances of a program on several machines. The machines run a kotlin program that manages the machine processes of the program instances locally. I want this kotlin program to communicate with the T3 server backend to listen for requests such as making a screenshot. I was thinking of doing this with a websocket. When the user opens the /instances web page, they will see the running instances of the program on the machines. I want the user to be able to click on Screenshot button and then the backend notifies the kotlin programs that a screenshot needs to be made. The kotlin program makes the screenshot and then uploads it to the backend. Then the image can be served to the user. ...
Solution:
ChatGPT Great answer...

whats the url of deployed socket.io server

i have a nodejs socket.io server idk the url to my websocket server in nodejs I do const io = new Server(1001, { cors: { origin: ["https://deployedclient.vercel.app", "http://localhost:3000"] } }) and client knows that the websocket is hosted on localhost:1001 ...

How does the Beta system of CT3A works?

I don't understand it. How can I use and find betas?

Prisma, self relation onDelete, onUpdate behavior

I have a prisma model: ``` model Comment { ... children Comment[] @relation("replies")...

net::ERR_NAME_NOT_RESOLVED Drizzle ORM

Hi, I have the following server component: ``` import { db } from "app/lib/db/index"; import { subjects } from "app/lib/db/schema" ...