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

content starting at a certain height

whats the best way to get content to start at a fixed position for example 25% height from the top on a 100% height page? just something like padding-top 25%? or is it better to use something like rem? and is there any good shorthands for this in tailwind?

Does tRPC replace client-side form validation i.e react-hook-form?

As you know tRPC has input validation in the router, but if you wanted to still have client side validation in your actual form, should you still use something like react-hook-form? I looked at the docs, and it only shows a general error i.e <pre>Error: {JSON.stringify(mutation.error.data.zodError, null, 2)}</pre> Is there a way to display particular field errors from the mutation? Something like mutation.error.data.zodError.title for example. Thank you for your time....

302 error when logging in with Discord

I have just done a fresh creation of t3-app, but i'm getting a 302 when the redirect URL is called for discord, same as this thread mentions https://github.com/t3-oss/create-t3-app/issues/952 However I am on next-auth version 4.18.6, any one else seen this?...

How to use useMutation with create t3 app

i tried implementing useMutation but i could not get it to work... i tried this (https://trpc.io/docs/useMutation) solution i found on the trpc docs but could not get it to work any help is appreciated!...

tRPC, Nextjs GetServerSideProps and satisfies error.

Hi guys, for some reason, when i use "satisfies" operator in a Nextjs getServerSideProps, i can't use tRPC SSGHelpers or Prisma Client. I'm getting this error, "ReferenceError: createProxySSGHelpers is not defined" and crash my app. But when i remove satisfies operator, all error are gone and my app is running again. What happen here? Example: export const getServerSideProps = (async (ctx) => { const prisma = new PrismaClient();...

Prisma - creating row with empty array fields

Hi, I have a user table in which I have a reference field of the Story table, written like this: story Story[] When I create a new user, since this field cannot be optional in prisma, I write it like this: `return await prisma.story.create({...

bad git config line

I'm getting an error about my last line of the git config, do you know why?

I am blind.. HALP! (oauth redirect config issue)

Hey gang, I know I am blind, but I just can't see what the problem is... just set up this toy app https://cha-chess.vercel.app/ ...

Reanimated Animation Wrapper (RN)

Someone here that has any example on how I can extend AnimationWrapperProps so that I can pass in custom animations or name of custom animations to trigger them? And also if you have any suggestions on how I can get the onPress to trigger animations that would be great 😄 ```ts type AnimationWrapperProps = ViewProps & Pick<AnimateProps<ViewProps>, 'entering' | 'exiting'> &...

tRPC query | mutation Error Boundary catch

With react query I can setup query client with default options for mutation and queries to useErrorBoundary: true and wrapping any components that uses a query/mutation with error boundary Im able to catch those errors. If I do the same for trpc react query query/mutations Im unable to catch those TRPCClientError errors when it throws. Is this expected? Do I need to do something extra? I though it works like reactquery and rethrow the errors but it seems it does not work like this ? Anyone had...

Redux Toolkit

Im new to redux, is it okay to store refs in redux store... should I disable the serializable check for it? or nah. What do you guys think?

Weird Next Image behaviour

Hey, I'm currently building a gallery that has pagination and the expected behaviour is to display a loading state on the images while they are loading. This works fine on the first page load (https://gyazo.com/b80b2b18a58abd0c089f3ade111a4235), but doesn't when I switch between the pages as seen here: https://gyazo.com/5d1b1e86f116e71f43ee208f02ae8c3f Any idea why that is?...

t3 getServerSideProps returns

After adding ```ts export async function getServerSideProps( context: GetServerSidePropsContext ): Promise<GetServerSidePropsResult<{ session: Session | null }>> {...

Astro Not Working on Vercel

I got an astro app with some react components. Dev server works fine and so is the build. When I deploy it to vercel I get code 500 error. Idk what I'm missing. This is my astro config file ```import { defineConfig } from "astro/config"; import tailwind from "@astrojs/tailwind"; import react from "@astrojs/react"; import image from "@astrojs/image";...

Planetscale + Prisma Connection Pool Limits

Does anyone understand connection pool limits? I'm a noob and am running into this issue:
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 17)
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 17)
Is it as simple as adding a custom connection limit in the database connection URL?...

Prisma error in production only

My prisma keeps saying sporadically that it cannot connect to the db, other times it has no problem with accessing the db, super confused

Video hosting solutions

I have a couple videos on a site I'm building and I'm trying to figure out what the best video hosting options are these days. Trying to avoid manually transcoding to all formats, and save bandwidth vs hosting on Vercel. What is everyone's favorite? Or maybe an all in one transcoding solution and I just host it in an s3 bucket?

Weird Question For People Who Have Some Experience With React Spring

I am working on a app where I am trying to add a parallax effect to the landing page. I am running into a bug however where there is a large gap between parallax layers where the speed is > 0 and the offset is 1. I am able to sort of get around this by setting the offset to almost 1 (eg: 0.99999) but this still leads to a bug where there is a large gap at the bottom of the page. Here is a piece of code that leads to the issue where there is a large gap between the blue and red layer: ```ts...

Prisma migrate returns error for a field that was already removed

Hi, i'm using prisma with cokroachDB and I made a few changes to my schema and tried to migrate, but prisma returns an error that mentions a field that doesn't exist (it did exist in former migration). It seems to not realize that I've changed the schema. Can I delete all past migrations? maybe it'll help...

Vercel takes ages to ISR from Sanity

My NextJS app deployed on Sanity has some data in the footer that's common on all pages. The footer data can be updated from Sanity incrementally. I have revalidate: 10 set inside the getStaticProps however it takes more or less 10 years for the data to update on the footer after I change it in Sanity. Anyone got an idea what the issue could be? I don't think it's being cached in the browser locally because I've tried it on other devices + incognito + clear storage. Thanks!...