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

Unhandled Runtime ErrorRangeError: Maximum call stack size exceeded

I have a server action that invalidates a user session when they click a button (a Signout button). Howeer when i click the button, i get the attached error. Does anyone see anything immediately wrong with this code?...
No description

T3 ENV fails when trying to generate migrations

When i try to generate drizzle migrations through drizzle-kit generate:pg it fails with message: ``` Invalid environment variables: { DATABASE_URL: [ 'Required' ],...

should package-lock.json be committed?

I see people committing package-lock.json to git repo always To me, i see it as a bad idea Because i have had many bad experiences with it, especially since i am using a Linux pc and the other contributor uses windows they is always strange issues with architecture kind of thing in the file ...

postgres(i.e. supabase) functions and triggers with drizzle ORM

i'm about to start leaning drizzle (can't use prisma because i deploy to a full-edge environment). before i dive deep into drizzle though, i'm wondering, how does one handle/create functions triggers using drizzle? doesn't seem like something one would put inside the schema file. couldn't find info on their docs either...

Stripe how to handle multiple price_id?

Hey folks, I've been trying for the pass 3 days with my friend GPT to implement multiple price_ID for stripe checkout but in vain, I'd be actually happy to offer you a big coffee for a deep dive on how best to implement this. My current flow is working with 1 single price_ID but it seems I'm struggeling with the mutation / trpc to pass different stripe price_id associate to specific price card in the front end here is the current code working with 1 price_ID (my price_id) is in my .env...

Storing additional data in Server Auth Session

I have some DB data (user profile) that I'd like to store alongside session and user in Server Auth Session so I can check for it in middleware. How do you do that? I would like to fetch it with Prisma.

Google Play distorting app screenshots

so as per various solutions I uploaded the screenshots in .png format with 2160x3840. But even after that the pixels seems distorted and dark gray colors sometimes becoming purple or different fro the usual color scheme. What can be done?...

form action not working

I have a server component where im importing a server action which i want to call when a form is submitted using the form's action prop, however im getting: ``` Type '(taskData: FormData) => Promise<void>' is not assignable to type 'string'.ts(2322) index.d.ts(2121, 9): The expected type comes from property 'action' which is declared here on type 'DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>'...

useTransition typescript error

I have a server action that looks like this: ``` export async function deleteTask(id: string) { await prisma.task.delete({...

How does React Query cache values?

I am working on a Plasmo browser extension that uses WebSockets to communicate with the API. I really need to cache previous responses because I need to keep a 'history' of all values and update them on an event. I know there's tutorials out there, even RQ docs have a blogpost about how to do this(https://tkdodo.eu/blog/using-web-sockets-with-react-query). But it just feels ambiguous to use queryClient.setQueryData() to kind of force RQ to use some data. And even if so, then the most correct way of retrieving data would be to use queryClient.getQueryData(["key"]) instead of something cleaner like useQuery(["key"])(it's requires queryFn). I want to know how RQ does the caching, so I could implement something simpler of my own without overhead for this specific case. Should I try a different caching solution or implement my own? Can I use RQ?...

stop env check on build

I'm building and deploying my app not on vercel. I build in a GitHub action so how can I disable the environment variable check there.

Twitter link previews with t3?

Hey gang, Andrew with river here. I am trying to setup link previews for some of the routes in our application, the open graph link previews are working (ex: https://app.getriver.io/events), but they do not work for twitter links (following the documentation) ```tsx...

Zod object validator using Prisma (MySQL) enum

Hey, could anyone hint how to create a zod validator object, which one of the keys should be an enum from prisma (mysql) ```ts model ProposalOption { id Int @id @default(autoincrement())...

Quick way to protect all routes under a certain parent route in nextjs (app router)?

Is there any way I can try and automatically run a function (I guess some kind of middleware) to determine a user's level of auth (I'll have access to this via an API call), and then prevent the render of said page and redirect, only under a certain route and its children?

OpenAi vs Hugging Face

Hey everyone. I’m currently working on a project where I need to summarize entire texts of a few hundred words into one sentence. I have some experience using OpenAIs API now, but I was curious if it’s better to use Hugging Face. I heard it’s cheaper and more flexible, but I want to hear from someone with experience. Additionally, I was also curious about the use of LangChain. Why would I use LangChain if I can use the LLMs straight from their api?...

MJML center two columns content in group

any mjml knowers can help me center two columns in a group? been trying different methods but I can't seem to get it working ```html <mj-section css-class="container" padding="0"> <mj-group background-color="#FFFFFF"> <mj-column width="20px" padding-top="2px">...

TRPC vanilla client load failed when called on mobile browser

Hi, I have created a vanilla client to use TRPC without hooks in a create-t3-app project: ``` import { createTRPCProxyClient, httpBatchLink } from "@trpc/client"; import type { AppRouter } from "~/server/api/root";...

x currently viewing

is there an easy way to display the current number of people on a page?

503

How implement CRDT's on WatermellonDB and Django (postgres) ?

Zod not returning undefined

I have this but it looks like zod has a problem returning undefined. I use prisma and I want it to do nothing which prisma does when value is undefined.
created: z.string().nullish().transform((val) => {
return val ? new Date(val) : undefined;
}),
created: z.string().nullish().transform((val) => {
return val ? new Date(val) : undefined;
}),
...