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

Any good starter templates for electron?

It's kind of weird that their documentation has no template any where. Is there some template thats up to date that can get the intial setup for ts electron project?

Tailwind vscode extension not working

Does anyone else have had the same problem where the vscode extension is not doing anything? I tried botha default Next 13 app and the ct3a project. Both on windows and wsl2 it doesn't seem to wanna work...

Clerk? Centralised Auth

I need auth provider that can be used: - In web app (Next.JS 13) - In mobile app (Prob. React Native - Expo) - In custom BE facing external customers (Prob. Apollo GraphQl - https://github.dev/howtographql/typescript-apollo) I'm trying to find out if Clerk is good for this or not but I'm not sure what I'm looking for. Does someone have experience in working with this stack?...

How to add auth property to NextComponentType

Hey, I want to add auth flag to next components to check if page should be protected. I tried extending its interface but without any success. ``` declare module "next" { interface NextComponentType { auth: boolean;...

Is it okay to have CredentialsProvider as JWT and save Google/Discord users in database session?

I want to use both GoogleProvider and have an option to use traditional registered with Email/Password. How would you go around this?

How to make <picture> with 'next/image'?

How to make that in Next with 'next/image'? <picture> <source media="(min-width: 1300px)" srcset="img/logo-desktop.jpg"> <source media="(min-width: 768px)" srcset="img/logo-tablet.jpg"> <img class="page-header__logo" src="img/logo-mobile.jpg" ">...

Prisma schema changes when moving from NextAuth to Clerk

With NextAuth I have a User schema that contains many relation fields. For example: ``` model User { id Int @id @default(autoincrement()) posts Post[]...

tailwind w- h- custom value's

Hello all, how often do you guys utilize custom value's over w-2 h-3? I see myself using them everywhere, but sometimes it just doesn't seem to feel right like there is an in-between that is missing and it makes me feel like I'm straying from the path

Internal server error vercel edge runtime

My project works on my machine, it builds on vercel just fine, but when I open the page it crashes the server. Does anybody knows what I'm doing wrong here? It will work just fine when removing the
export const runtime = "edge"
export const runtime = "edge"
...

identical urls page vs api

Noob question - If my site has a page at /posts, but my api also has a /posts route. Is it possible to differentiate? Should I prefix all my api routes like /api/posts for example?...

react-hook-form types

I'm using react-hook-form with typescript and I changed from using the useForm to the useFormContext and Typescript brought to my attention that the types of the errors are not the same. Using useForm, errors.firstName.message is of type string as I would expect, but with the context version, the type is string | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined. Why are these types different and how do I just get the message while using the context version?

Infering procedure input from prisma type

Hey, is there a way to infer the input validation from prisma entity? maybe with some utility something like this, which is wrong ```ts upsertOrder: protectedProcedure...

hydration the initial UI does not match what was rendered on the server with next-theme

big time next js noobie here, using next theme as my dark/light mode solution and it keeps giving me this error. my code:

Auth: which solution for which situation

Next-Auth/Auth.js vs Clerk vs Supabase auth vs firebase auth vs other solutions: for which situations would you pick one over the others? Do you have any preference for other tools (e.g. Auth0, passport.js, etc.)?

What is the best typesafe tech stack for a chrome extension?

I am currently trying to build a chrome extension for a side project. From my research their seems to be no easy way to start if you are wishing for type-safety without having to set everything up from scratch. Is there a t3 stack equivalent for this type of application?

How does one use prisma enums with zod when creating a new "post".

For eg. A post has tags -> Tag[] enum Tag { "BUSINESS" | "DESIGN"} What is the best way to use the prisma enum with zod....

how to add a column to my database in production without wiping database (prisma x mysql)

I want to add a column to my current user table I want to add a column called verified and defaults to false But we are currently in production with large users i can't afford data lose any ideas?...

Help with (new) monorepo tsconfig

Ive just started merging two codebases into a monorepo basically i have FM and reporting...

uint256 in mysql

what's the most sane way to store an amount like this in a db? Decimal(38,18), a bigint of wei like Decimal(38,0), a hex string like binary(20), varchar (lol), something else?...