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

how to see changes on .env file when .env is in .gitignore

I'd still like to see the changes to my .env periodically and was wondering if anyone has any advice around this

Can I save more user data with NextAuth than simply what my provider gives?

I want to save a username as well as the slug for the user's homepage, but can't figure out how to do this. Things break when I add these to my model, telling me Invalid p.user.create() invocation in at the user creation invocation

How to update and upsert on particular columns on Prisma

On Prisma, I have a session model as follows ``` export type sessionsCreateInput = { id?: bigint | number hash: string...

When is concurrency an issue?

At what point/scale does concurrency become an issue in a web server? I followed Primeagen's videos comparing Rust, Go, and Node and I take his point that Rust is more performant. But at what scale does this matter? ...

Can we use tRPC api for any other platforms like Native languages?

Can we use tRPC api for any other platforms like Native languages? [I would like to use it for React Native]

Trpc giving a type error?

Im trying to get a trpc endpoint to update my db and i keep getting this error.

isSuccess correct value to check response in trpc?

Hello I am wondering if isSuccess is the proper value which I should check once I call my mutation. Sometimes the function inside the isSuccess condition does not run, even if my mutation was successful. Any idea how to improve that? ...

Does NextJS static export really suck?

I've been hearing our fearless leader's recommendations for Astro JS for static sites, but Astro really seems more focused on blogs or pulling all the data at build time. If I'm building a simple static site for a S3 bucket & working with a rest API backend for CRUD, it seems like NextJS static export is fine? Is that so or would Astro JS still be better to use than NextJS in this situation? Or would something else be better, like just using vite + React Router? As some back story, its not my choice to be stuck with an S3 bucket / static site situation, I'm on a team of not web devs and they want to keep it "simple". I've been learning off-on for the last few years but am now diving all in on Next js and react so I'm excited to work on "something" web dev related that'll have a large impact 🙂...

getStaticProps runs multiple times!

Have no idea why this happens, few threads on github but no solution it seems. When it runs, only one of the runs has the proper params, the rest are just undefined. ```ts //[pid].tsx...

Railway React deploy error

has anyone got this error while trying to deploy react app to Railway? FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory...

React hook form append custom key value

I have a form with an input type text, I can add text and click on enter to add the value to an array. I want to save the data from the array to my form, but currently tags is still undefined once I submit. Any ideas what I may be missing? ...

Is trpc returns promise?

I am pretty noobie, accept that. Is trpc returns promise? If it doesnt how do we handle errors?

Stripe - can I use tRPC for Stripe's webhook?

I'm building a Strip checkout and I am wondering if it is possible to use tRPC endpoint for handling Stripe's webook. I have one more question regarding to Strapi, how can I verify what custom has paid for the product? (I am using T3 stack)...

Cross platform authentication

What would you recommend for authentication in a cross platform (web / mobile) application? tRPC will be used for BE and for DB I'm not certain but leaning towards a postgres db handled through Prisma...

TRPC still looks for old column name after renaming

So I updated my prisma schema and also renamed my column in my table. But somehow I still get an TRPC which says that the column name is wrong. ``ts TRPCClientError: Invalid prisma.customer.create()` invocation: ...

Please help with complex form query state management mess

```ts type EditChapterInput = { content: string, id: number, title?: string...

SSR to help mitigate slow client data transfer and improve TTI?

I'm involved in an ongoing saga at work to improve the state of a SPA that is just an order form. This app was built with CRA before I started working here, and we are rendering on the client-side, fetching data via GQL (7-ish requests in total), then doing a bit of processing of that data before setting in state and allowing full interaction. I've had some success moving the app away from using Context for everything and triggering tons and tons of updates, and also restructuring the way in which we are fetching data. However, I'm still not fully happy with the performance of the app on mobile. I've been told that we do have users that may be on slower phones and with connections as slow as 2G worldwide, and so I'm looking to see how I can potential mitigate some of the issues a user may run into. Please forgive me if this is a super basic question, as I'm not incredibly familiar with SSR/Next in practice and I could just have a fundamental misunderstanding. But it struck me that if a big area of concern is the potential slow speeds of CPU/network on the client side, it might make sense to send off for the data necessary to allow interaction on the server-side with something like getServerSideProps. This data is not consistent and varies depending on the URL's query string, so unfortunately generating something static and rebuilding doesn't strike me as feasible....

Changing URL but components re-rendering.

I'm working on an application wherein you click on various chapters of a story and it should update the form fields on the page with that chapters content. The URL is changing correctly, but the form fields are not rerendering with the new content. What do?

Weird React error

When I show a notification or a modal that is outside of root div. In each render, this error will occur and this is not the first time that this happened. I investigated it a bit, but I couldn't find a solution. This error happens exactly when I call a notification that is set to be positioned absolute or outside the root div. It says can't set the property of undefined, but I can't find it I guess it's deep into react...