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

UTapi or is there Something better?

I have to make a form in which when i submit the form, the images are uploaded to uploadthing, and then all formdata along with the urls of the images are added to the database. Previously, I made an next js route handler and used utapi to which I gave the images via formdata and get back the urls and ids. I am currently refactoring a lot of apis and components. I have also upgraded to uploadthing v7. I was wondering is utapi is a still way to go or is there something else better....

Mishap with drizzle and singlestore

I was following Theos tutorial => https://www.youtube.com/watch?v=c-hKSbzooAg And when I first tried to run the pnpm run db:push nothing worked! I debugged and realised that a simple change from SINGLESTORE_HOST: z.string().url() to SINGLESTORE_HOST: z.string() will make it work!...

Correct way to add clerk auth to trpc

Hi, after 3 days of learning t3stack, i encounter some problems trying to create an privateProcedure, that using getAuth from and passing the "req", does not work, showing something like headers not defined, so i tried to modify api route, to only pass req, and not headers but also not working, im using app router, and i search on internet, and all solutions is for pages router, TypeError: Cannot read properties of undefined (reading 'headers'); The error will be redacted in production builds example code...

Fine-Grained Reactivity (Signals) in Qwik

Qwik (the JavaScript UI framework) uses signals for reactivity, meaning it should only re-render the DOM elements that directly depend on reactive state rather than the entire component that uses said state. However, consider the following example of conditional rendering: ```javascript import { component$ } from '@builder.io/qwik';...

Looking for a Mock Interview for Frontend Intern Role (Next.js Focus)

I am currently preparing for an interview for a frontend developer intern position. This will be my first interview and I am not sure what to expect. Would appreciate any tips or resources that would help prepare for the interview. Also if you have some time and would be willing to run through a mock interview, I'd be very grateful....

Fetch data in Next app to be available across all app

I am building a NEXT app and I have 4 routes in it, I already have reusable components, but I don't really know how to properly fetch data in one single place so that it would be accessible across all routes. Help?

shadcn Combobox (CommandGroup) Not Re-rendering with Component

I have this combobox component (https://github.com/tylerpashigian/t3-recipe-book/blob/feature/creatable-combobox/src/components/UI/combobox.tsx) built on shadcn’s combobox that allows for multi-select and creating a custom option if there are no search results found. I am running into an issue where a user may want to create a custom value even if there are similar results. On the branch I linked, I’ve added the avilableOptions variable, which should add a custom option if the search value isn’t empty and the props allow for custom values. I am seeing something strange where the value is correctly added to my availableOptions (tested by logging the values) but it is not reflected in the options in the dropdown. However if I close the popover and I reopen it with the value in the search field, the option is available. I assume this is due to one of the nested components not re-rendering properly. Does anyone have an idea on this? To provide some context, I have a recipe book and I’m selecting from predefined ingredients, but adding a new one if it doesn't exist. This works if there are no results found, but when trying to add "bacon”, “dry elbow macaroni” is being returned as a similar search result....

Trojan Virus in React Project!!

Recently, someone invited me to work on a React project. The job seemed suspicious, and I had doubts. Usually, if it's a scam, they send files containing malicious code. However, in this case, they asked for my GitHub username to send me an invite to a repository. Everything seemed legit, but I still felt something was off. I downloaded the code, which contained two folders—one for the frontend (React) and one for the backend (Node.js). After running the project, I noticed that Python was installed in the background, along with Python scripts running and requesting permissions. I installed Malwarebytes, and it detected a TROJAN. I still have no idea how the Node.js project installed the malware....

REAL QUESTION!!!

What breed of cat does Theo have? He is so lovely...

Using credentials provider

Hey guys! I was looking for some kind of info on how I can use credentials provider with NextAuth while using ct3a. I know its insecure and isnt recommended for use and all that but I have a client who wants it. Can anyone help out or point me towards an implementation that works? For context I am using the latest version of ct3a, Prisma, NextAuth, trpc and app router I have added the credentials provider as follows:...

Client-side Exception Occurred

What's the best way of handling this (nextjs client-side exception)? I've already checked the docs and it recommends error boundaries, which i do understand the reasoning but it's not what i'm looking for If i understand error boundaries correctly, they will render something completely different when you get this client-side errors, what i want however is for the client to render just as is despite the error, 99% of the time anyway, i get these kinds of errors when I try to get a property and it doesn't exist / is null / undefined, in that case, i don't want the entire app to crash, i simply want it to not render whatever is missing So how do i do this?, i.e. just ignore the error and if things are undefined them let them be undefined...
No description

Curious about Next.js Errors

Hi all, just wanted to ask if anyone else has been able to find first-party documentation on development errors with Next.js. I'm facing an error, example: "Error: Page "/[root]/[article]/page" is missing param "/deep-dives/x" in "generateStaticParams()", which is required with "output: export" config." . Due to the lack of documentation on Next.js errors during development, I'm out of ideas on how to debug further, apart from just asking an AI for help. P.S., I'm not just looking for a solution of the error above. Instead, I'm trying to better understand how to debug the framework....

App Router and Page Router

Hey everyone, I'm new to T3 stack. Just had some confusion on the initial setup. I see next has both app router and page router, with app router seemingly the path they are investing towards in the future. I'm curious when I created my t3-app. I have an app and pages folder. My understanding was that you either have one or the other depending on whether you are using app router or page router. Looking at the T3 docs, there's also a section on Folder Structure (Pages) and Folder Structure (App) https://create.t3.gg/en/folder-structure-pages. Ideally I want to use app router, would anyone be able to explain what's happening in my setup since I have both?...
No description

tRPC streaming in mutations

tRPC supports streaming responses of useQuery using async generators, which I can use to yield return data to the frontend and get an updating list of stuff. I want to implement the same return with a useMutation, but that one doesn't resolve the async generator into an array but passes it through to the frontend. Does anyone know why these behave differently and how to work around this?...

Upgrading to Next 15, infinite refetching, no cache?

Hi, I'm trying to upgrade my t3 project that I started with next 14 a year ago, to Next 15... I've used the codemod for it an Clerk to v6, but I'm getting a problem when I load a page, it queries again and again, infinitely, putting a huge load on my server. I have my Query Client staleTime at 30 * 1000, but doesn't seem to be taking it into account....

Limit messages per month

Whats the limit on the free version? I just wanna know how much more ill get with the paid

Terrible Uploadthing performance with German ISP.

Could someone perhaps have a look at whether or not there is some blacklisting being done by TELECOM in Germany, the majority ISP here. I can in no way bypass their blocking of uploadthing hosted files through my router except for using a VPN. I've done a bunch of testing, and as far as I can tell, it is only when traffic is going through my router. The download times are in the range of 30s for 50kb which makes my product essentially unusable. I would really appreciate any help anyone has to offer. I'm at the point if phoning up my ISP personally... Cheers. :PepeHands:...

Why is this component not fully SSRed, how can I do it and what learnings can I take from it?

So, My understanding is: export default function ServerComponent(){ return <div> // some normal HTML tags <ClientComponent/>...

Expo Monthly Active User question

So I asked this in the expo discord, but my bet is I'll get a faster answer here. I'm real interested in Expo, but my idea is going to have a rather small revenue per user, so looking at the costs of Expo I am wanting to make sure I'm not about to make a money pit off of the MAU costs. So the documentation appears to cover it decently well but I have a single outstanding question that looking at the documentation doesn't appear to have answered: Is a "Monthly active user" a download from the app...

Does anybody have experience with Proxy Re-encryption?

Hiya! I'm trying to make a prototype for an app with a pretty complex set of requirements. ``` - Alice wants to share a secret message to a group of people she trusts. - This message can only be shared in a decentralized system (not blockchain!!), where everyone can see every message sent. - Once the message is sent, it can not be changed, and neither can the data attached to it, like a decryption key....