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

tRPC with part on NextJS Lambdas and part on Edge

How should I go with splitting tRPC to have some functions execute on serverless/lambdas and some on edge functions? I tried creating two separate routers with nested withTRPCs, but it didn't work.

Fetching data but getting error:null and count:null in console

Here is how i implemented it ```const [search,setSearch]=useState('') const searchUser=useCallback(async()=>{
const data = await supabase.from('profiles').select('name').eq('name',search)...

In appdir, what should the type of children be?

Current getting an error saying that children is implicitly of type any. What is the recommended type to use for it? Thanks! ```tsx // app/layout.tsx export default function RootLayout({ children }) {...
Solution:
Current getting an error saying that children is implicitly of type any. What is the recommended type to use for it? Thanks! ```tsx // app/layout.tsx export default function RootLayout({ children }) {...

Is it possible to deploy t3 app on firebase?

I have specific requirement of running the serverless function for more than 5 minutes. and vercel does not support it. where as firebase provides max timeout of 60 min. which is perfectly suitable for me. Greatly appreciate any other suggestion?...

TRPC Middleware

How can I create a TRPC middleware function where I can inspect the HTTP headers? I'm in trpc.ts in the server and see the documentation, but I can't piece it all together. ```ts export const activatedMiddleware = t.middleware(async (opts) => { const { ctx } = opts;...

Cloudinary Image Render Issue

Has anyone had an issue where your web app doesnt fetch images from Cloudinary after production deployment? Uploading & displaying works fine in localhost but in production the images only upload, then only appear when i redeploy after upload (hosted on Vercel). I'm also pulling data from PlanetScale and that works fine in production.

Is there any good way to implement Steam-Auth in NEXTJS app?

We have next-auth - and it's great. But next-auth doesn't support steam as a provider because steam is stupid shit. So the best way to implement steam-auth it's by using steam-passport But dude, I don't wanna create getServerSideprops in every page file....

What's the Best React Library for Pie Charts?

Hey everyone, I'm looking to create a pie chart in my React app and I was wondering which library you would recommend? I've heard of a few options like Victory, Recharts, and Nivo, but I'm not sure which one to go with. Does anyone have any experience with these libraries or have a different suggestion? Thanks in advance!...

NextJS React Server Components with tRPC

Hello all 😄 I tried to give this one a try and I see there are just "hacky" ways as tRCP doesn't seem to have been implemented to be more server side. Does anyone know when this might be changed or anything from the team? The app I am building is still new and I am transitioning to Theo T3. Saw the Next13 convention and I am hooked to try the new app directory. Have a great weekend...

Prisma `delete` a row with composite keys

I’m trying to delete a single row in Prisma using composite keys x, y. Is it possible to write a query like prisma.table.delete({ where: { x, y }) or do you have to use deleteMany , which presumably doesn’t have a limit 1?

Type Promise not asignable to type Awaitable

What am I doing wrong here and how can I fix it?

How to create custom Procedure for serverlesssQ cron provider. And call trcp router.

i want to have a Cron job which calls a handler. this handlers should check if it's authorized or not. (handler in api/cron/reportDatabase) This will call a trcp api router, but i don't know how to secure it. Like how to create a custom procedure for it...

Similar site on multiple URLs

Hypothetically speaking. I need to build a page for a client. I really want to use NextJS for it. The client wants 4 website. One main website, and 3 "sub"-websites that will be hosted on the different url. Sub-websites should be basically the same as the main websites but with different news sections, logos and some elements. I want to have one codebase and one database for everything. Having one database should be no problem, but can I do it with only one codebase as the url will be different for every website? Are there any suggestions on how should I approach it?...

Why prisma do 2 seperate Queries instead of 1 left join?

``` const sessionByRefreshToken = await prisma.session.findUnique({ where: { refreshToken: refreshToken.token, },...

Issues importing a class in the provider folder of AdonisJS while creating TypeScript definitions.

Could anyone help me with an issue I'm facing while building a database wrapper for Prisma in adonis? I am trying to create a typescript definition for it, but I'm unable to import the Database class from providers/DatabaseProvider/database.ts. I've tried recreating the project multiple times, but the issue persists. Thank you smmmm contracts/DatabaseProvider/database.ts ```typescript declare module "@ioc:Evermore/Database" {...

2 queries in child component or 1 in parent component

lets say i have 2 components that need that same data to i query once in the parent component and pass it as props to the child or do i query once in each child component

PlanetScale workflow confuses me

So, I'm not even sure if I should be doing this, but I'm working with a few people on a T3 project and we chose to use PlanetScale (free tier) due to the simplicity. However, as we modify the database, we realize how the workflow doesn't seem to make sense, so we have been wondering if we're doing anything wrong. As we are using it free for now, we only have one Dev branch, so we all work on it and deploy the changes....

What react date picker are you using?

Currently in a need of react date picker, that allows min/max selectable dates, allows month view, date selection, date range selection and most importantly can be easily styled using tailwind. Any suggestions? 😄

shadcn ui dark mode

Hi guys! Are you using nextjs with tailwind and shadcn? How do you implement dark mode?

Any ideas why TRPC doesnt find the mutation?

I have am trying to use a create many Prisma call in a TRPC mutation as follows: ``` import { z } from "zod"; ...