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

Good RBAC implementation for create-t3-app?

Hey, I was looking for a good Role based access control implementation example or library that I could use with ct3a. If anyone has any references, please do let me know. Thanks!...

Error uploading file

When I try uploading a file on UploadThing I get this error: "Error uploading file" What I have done to try fix the issue: - Switched browser - Verifying no file with the same name was already uploaded...
Solution:
The error was fixed once I created an API key... (as I deleted the one set by default)
No description

Using Package level .env in Turborepo

I have apps/ web and packages/db folder. packages/db src index.ts...

silly question about cloudflare worker billing

hi. i'm currently screwing around with cloudflare workers to see if it's viable for a thing i want to make. i'm using the free plan and i very specifically do not want to be charged (but cloudflare has my payment details because i'm using the free tier of r2). my understanding is that the free tier of workers limits you to 10ms CPU time per request and just kills the worker after that. and yet my median CPU time is showing as 617ms, see the attached image. is there a way i can verify if this is right or not, and more importantly, is there a way i can check if cloudflare has suddenly started billing me for workers paid or not...
Solution:
No description

Always failed to fetch the image url

I don't know if my internet is slow, I couldn't fetch the image from uploadthing, even I direct to visit the image url on the browser.
No description

App Router & tRPC Server Cache

How do you handle caching server queries with tRPC? I refuse to believe there's no good & easy way to do that. What am I missing? Client Components feel faster as it's easy to cache the response on client. Server Components feel fast on first load but trigger queries on every render, making it feel slower. Currently using:...

How NextJS REALLY Works

Is this still good video to understand how Next actually works?
No description

How to get Auth.js 5.0.0 beta middleware to work with Next + tRPC

I have a long time project with Next, tRPC, Prisma and NextAuth, that worked flawlesly on Next 14, Prisma 5.x and NextAuth 4.x. Now I initialized another create t3 app and I'm trying to figure it out for hours already. I was using middleware before to handle my route protection, but this time middleware, according to the official docs, will in the end have to use the authConfigthat has PrismaAdapter (@prisma/client) inside, and thus it throws an error, saying that Prisma can't work in runtime. My tRPC procedures are protected with the default protectedProcedure that comes out of the box with create t3 App, but I just can't figure it out how to use the middleware in Auth.js 5.0 ...

Custom Hooks using tRPC API

I want to create a custom hook with the function I created in tRPC routes. ` getUserDetails: privateProcedure.query(async ({ c, ctx }) => { const user = await db.user.findFirst({ where: { email: ctx.user.email,...
No description

How to improve Next.js performance after latest Theo video on why Nextjs is slow?

In his latest video, he highlights that it's probably bad if a page is Dynamically server rendered on demand (has the f symbol on the build output): https://youtu.be/mMQCLQTky34?t=2244 I tried it on my app, and literally every single page is ƒ (Dynamic) server-rendered on demand What is going on and how can I fix that. In the screenshot provided, I am literally just rendering "hello" - why isn't that statically prerendered? Is it because of something in my root layout.tsx maybe?...
No description

Any advice

Hey! Im 22 years old about to finish college and been applying to Web dev jobs since last summer. I have been very unlucky and not gotten a single interview only rejections. Do anyone who has been in same situation have any advice! I would appreciate any advice, starting to lose hope but, trying to stay strong!! Take care!...

How to config test in the t3 App?

Good afternoon, how are you? I'm trying to configure my Next.js project with tRPC to run tests. I've tried following the documentation for Jest, Vitest, and even the official documentation at this link: https://create.t3.gg/en/usage/trpc#sample-integration-test I’m not sure what I’m doing wrong — I’ve tried many different approaches. Could someone share a step-by-step video or a more complete tutorial?...

Dealing with AWS Lambda concurrency limit

Anyone running their API's in lambda at scale, how are you dealing with the per account concurrency limit? We have a failed attempt at microservices at my job and I'm trying to revamp our architecture to allow us to scale up in the near future. We have a few things running in lambda already but as we grow I'm worried about how the concurrency limits will impact us....

Need help to integrate Odoo in our system

I'm building deaf people interpreting service system using Angular/Spring boot. Now we're on final stage and I'm going to use Odoo plugins for invoice & payment system. I had some digging and could have some knowledge about Odoo. It provides XML-RPC based api for the model connections. But I'm not sure how can I integrate exactly. I'm going to install own Odoo system and would like integrate it with backend side. If anyone has experience, please boost me....

Playwright Electron (Vite) returning the DevTools window instead of the main window

When running a very basic playwright test on electron, for som reason firstWindow() is returning the devtools window. ```import { test, expect, _electron as electron } from "@playwright/test"; import path from "path"; ...
No description

Playground for mock api

Hello, i have to create a playground simulation similar to this https://docs.validis.com/docs/validis-api/66dd45bc69103-get-connectors WHat would be the most optimal way to go about it? The working of the authentication, parameter and response is something i have to take as per requirement but are there any third party libraries which i can use for my particular requirement? ...

How are you supposed to handle loading states for trpc (useQuery) calls in client comps in Next?

I have a client component that calls for data via trpc. I extract isLoading from those useQuery calls and then I want to display a loading skeleton while the data is loading. However, when I follow the normal React render pattern (check isLoading -> render skeleton; check if data empty -> render null; otherwise render content), I get an error about hydration failing because inital UI does not match server-rendered UI. I think this is because the isLoading state is always false on the server. This isn't an issue in standard React (non-RSC), because you make your useQuery call before trying to render anything, so isLoading is already true before you reach that render pattern logic. ...

VSCode theme

i always wanted to know, what is Theo's theme for his editor?

What’s the point of leetcode style interviews?

I can code, I build good products with great performance and good UX, I understand data structures and algorithms and know when to use what. Leetcode feels like trivia to me, and I despise trivia. Currently looking to get a new job since I won’t have one around July, and I have to grind leetcode questions instead of spending that time doing things that interest me and learning new things. I’m about 60 questions in, I hate every single part of it, it’s just frustrating and annoying and I feel like I could do better things with my time....

Elixir/Phoenix Journey - Share Your Wisdom!

Hello! I'm venturing into the world of Elixir and Phoenix (coming from a Next.js background), and it's both exciting and a little daunting. The learning curve feels pretty steep! I'm curious to hear from those of you with Elixir/Phoenix experience, especially anyone who's made a similar transition from Next: what were your biggest "aha!" moments, what resources really helped you level up, and what was the trickiest thing to wrap your head around at first? I'm open to any and all suggestions – books, videos, hidden gem websites, anything! Thanks!...