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

SWR - If loading is false and error is undefined, what can we assume?

If isLoading is false and error is undefined, can I assume data is not undefined? (using typescript) Is it ok to always have to use data like this data?.something (since it is possibly undefined). Is there a more standard way to know for sure when data is ready to be used on the UI? Should I always do something like data && <Component/>?...

Infer nested type of trpc router return type

I have a tRPC router than returns a nested object through a db query. It looks like this: ```ts ILessonCommentProps.comments: ({ _count: {...

Can't disable Vercel cache

I am deploying nuxt to Vercel and have NuxtAuth (Wrapper around NextAuth). I am having trouble preventing Vercel from caching any endpoint I have added no-cache, privateto the cache-control header yet on the same request I'm seeing x-vercel-cache: HIT I have also added '/api/**': { static: false, cache: false } to my routeRules in my nuxt config. Is there some setting on Vercel that I need to change?

Error: npm lint not seeing env type

I converted my existing project over to use the same template as ct3a. However, when I run npm run lint it throws a @typescript-eslint/no-unsafe-member-access error for every place in my codebase where I import { env } from "~/env.mjs", saying env is an any type. I can't seem to figure out what is causing this, since vscode still shows the env type when I hover over the import and I've double checked that my eslintrc.cjs and tsconfig.json are setup correctly.

Error: Failed to collect page data for...

Error when building app dir with dynamic route

Contributing to open source

Hey folks! I wanted to ask to anyone that managed to contribute to open source in a project for a long period of time. I've read a lot of blogposts about this but most of them talk about finding good first issues in several repos and doing simple tasks. What I'm looking for is for a project that's preferably early in its development and that I can contribute to. I currently have 1 - 2 years of experience in Typescript (mainly all the T3 stack except for tRPC) The question would be how to actually search for this types of project, and how to asses if they would be a good fit for what I'm looking for Thanks in advance 🙂...

Error: backingFormData.forEach is not a function

anyone else seeing this when trying to use new nextjs server actions? Error: backingFormData.forEach is not a function ```...

Difference between Turbo and T3? When to use create-t3-turbo vs create-t3-app?

If create-t3-turbo is simply the T3 stack + mobile development, should I always just create-t3-turbo because it leaves open the possibility of making it a mobile app later on? If not, is there a way to easily add the mobile functionality to a codebase that uses the normal T3 Stack?...

t3 stack with Clerk profile creator

I’m just trying to create a profile for the user on sign in/up if it doesn’t have one, I was trying with getting the profile and if data is null instead to return an error (don’t found how to handle the error in the front) get a null and redirect it to a route to complete the profile data, but once I mutate the profile with the data and push the route again to / it is cached with the null value and it redirect again to creating page. Anyone knows how to clear that cache or have a better method to do this case ?...

Error: No QueryClient set, use QueryClientProvider to set one

The error is coming from this snippet ```tsx const { data, isLoading, error,...

[Solved] How to use Vercel Cron Job with T3?

Hey! I am using T3. I am new with TRPC and don't know how to handle Vercel Cron Job. I want to add some data to the database everyday. How do I do that?

Know any good scheduling and appointment api. I need b2b scheduling.

Looking for a service/api to provide my clients with the ability to schedule appointments between them and their customers. Idealy it integrates with google calender/microsoft calender stuff too.

Next TRPC backend Extension

hi i have a t3 app. now i want to use the same backend apis on another next app how can i do that.

Auth0 with Astro

Have you guys ever used Auth0 with Astro? I'm basically having the same issue described here https://stackoverflow.com/questions/75890630/error-you-forgot-to-wrap-your-component-in-auth0provider-auth0 but this thread has no answers, any ideas?...

Railway: Connection reset by peer

Hi all, I have tried a few small T3 builds using Railway, but sometimes found the database unresponsive. When I check the logs at Raliway I notice this error: 2023-05-08 16:06:05.439 UTC [24034] LOG: could not receive data from client: Connection reset by peer 2023-05-08 16:06:46.716 UTC [24111] LOG: could not receive data from client: Connection reset by peer...

Next.js metadata title template

My main layout has the example shown in the next.js documentation ```js export const metadata = { title: {...

Aborting a T3 mutation

is there an easy way to abort a mutation from a t3 stack?

Acessing a route api in app dir causes re-render loop.

okay, I'm just trying out the next js app routes. I'm getting a render loop when using it like this in /app/page.tsx: ``` "use client" const getData = async () => {...

upstash-like redis interface

I was looking for a redis interface that used HTTP without requiring me to use upstash exactly. I found this project (https://github.com/nicolasff/webdis) but I'm not sure it's "production ready". Anyone has other options that are maybe more battle tested?...

Revalidate prisma query in `page.ts` RSC

I'm getting the same data every time I visit this route. ```typescript import { prisma } from "@acme/db"; import EditForm from "./edit-form"; ...