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

Product hunt hunters

Im about to release my Saas built with t3stack on product hunt. Do you guys have any advice that I can use? Is it a good idea to launch it on saturday? I want it to be less competetive since I doubt I will break through other products who have better marketing strategies...

Planetscale UUID

Can anybody suggest how to use uuid as primary key in planetscale with drizzle orm?

Sentry TRPC config not working

I followed this guide on integrating sentry into a t3 app (both frontend and backend) https://github.com/getsentry/sentry-javascript/discussions/8500 My frontend errors are properly getting caught, but sentry is not intercepting my backend errors....

Linking NextAuth Discord provider to Discord user calling a slash command

I've got an application that allows users to sign in using the NextAuth Discord provider. I'm creating a Discord bot with a slash command that, when called, will create a chat room on my application and then reply to the user with a link (basically just a prisma create, return object id). My issue is that the user needs to be assigned the room owner, so that they can only have 1 active room. Is it possible to do this? I was hoping to just find the user by email address but this isn't returned by the Discord API. It looks like the user's name doesn't update in the db if they change it....
Solution:
It is the Discord user id is store i can’t remember if it’s in user table or account but create a user and search for the id 👍

How to handle authentication in nextJS app with AWS Amplify

Hello everyone. I'm creating a new app and I'm trying to figure ou what would be the best way to handle user authentication. The user signs up with an email and a password, they then get a verification email in their inbox (that's all handled by AWS Amplify). I have a few questions like:...

CSS is missing

Set output: 'export' in next.config.mjs file, css is missing GitHub link: https://github.com/birchrust/cv GitLab link: https://gitlab.com/birchrust/cv.git...

Can't run drizzle db:push due to error yet the code hasn't changed

So i am trying to push my new schema to planetScale however i run into this error: ```bash Error: target: meally.-.primary: vttablet: rpc error: code = InvalidArgument desc = Invalid default value for 'createdAt' (errno 1067) (sqlstate 42000) (CallerID: 9d6l772g9pp919ug46mn): Sql: "alter table recipes modify column isPublic boolean not null", BindVars: {REDACTED} at PromiseConnection.query (G:\GitHub\Meally\node_modules.pnpm\drizzle-kit@0.19.8\node_modules\drizzle-kit\index.cjs:35317:26)...

Trpc google authentication passport

```ts const GoogleAuth = middleware(async (opts) => { passport.authenticate('google', { failureRedirect: '/login', successRedirect: '/protected' }) return opts.next() });...

how to send video and audio as UDP format using webrtc

I am creating a live stream app in which I need to send video and audio to server. Before sending I need to convert it to UDP for further processing.plzz help me

'npx prisma db seed' not responding

anyone have this issue where seeding the db does nothing and gets stuck? screenshot at the bottom of this post this is my seed.ts ```...
Solution:
oh i figured it out, you don't set the schema to password: password, you just say password

Recommendations for Advanced React and Design?

I'm an experienced developer in the mid-senior level and have a good amount of experience (2 years) with React & TypeScript. However, it feels like I am missing knowledge on how to build out advanced, complex websites that are also beautiful and well-designed. Does anybody have any good courses or other resources they could recommend which would teach me these skills?...

Intellisense unbearably slow

I have a decently large project setup with T3 stack, with a lot of inferred trpc routes. The intellisense is literally almost unusable, and the type checker is unbearably slow. - Getting an import into the "quick fix" takes about 10 seconds on avarage - Getting an error to show in my editor from typescript takes about 6 seconds after a change (checked via ts logs, it's fairly consistent 6seconds). - Intellisense stays at loading for a good 3-4 seconds before anything even pops up. ...

.env parsing causing cypress failure

I'm adding cypress e2e tests to a project I'm migrating from Angular to create-t3-app and thought I'd try out component tests too. Unfortunately trying to run the component tests results in a failure when parsing the .env vars. ``` Error: Invalid environment variables at onValidationError (file:///home/curiouslycory/workspace/sudoswap/sudoswap_xyz/node_modules/@t3-oss/core/index.ts:128:13)...

Use Effect causing infinite re-renders

Hey everyone, I'm a little confused on how to fix this, I'm fetching a list of engineers which I want to be able to use in a select dropdown, but when trying to map over, and set to state, its causing an infinite re-render, here is my code ```tsx function CreateTimesheetScreen({ navigation, }: RootStackScreenProps<"CreateTimesheet">) {...

Prisma with two databases

I'm migrating an application and it uses two different databases - MySQL and Postgres. I know Prisma has an experimental feature to use multiple schemas, but that seems to be limited to a single database. What would be the best way to handle this?...

How to fetch local API with App Router

Hello everyone, I have created several apps with CRA on the past few years and don't have a lot of experiences with Nextjs I jumped into it for a year now and when App Router launched, I tried to do my new projects with that framework. However, I am now stuck with what looks like a simple task....

How to extract tuple from array of objects for Zod enums?

```ts export const PLANS = [ { id: "0", name: "free",...

Next.js Image Optimization killing Quality and Saturation

Hey yall - unsure if this is a bug in Next.js or if I'm misunderstanding how to use the <Image/> component. When i have an image component like this: ```tsx <Image...

How to keep React state and db in sync with each other

I am making a like feature for a post where if user likes the post the counter increases on the ui and registers the like in db but sometimes the like counter goes into negative. ``` const PostPage: NextPage = ({}) => { const router = useRouter(); const { slug } = router.query;...

update data via react-hook-form

Hi, I’m trying to create some type of update functionality to my website using forms. Basically the idea is to fetch from the database and offer the user the possibility to change the details of each field as well as adding/removing fields. You can think of a structure similar to a résumé builder. Is react-hook-form the correct technology for that? Or should I consider something else?...