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

TypeError resolver is not a function at apiauthsession endpoint

Im trying to configure Google Credentials with the Google API to have the login working. Ive put the URI redirect to http://localhost:3001/api/auth/callback/google (im using port 3001) On my Signup button i have ...

How to return additional fields from user in session callback next-auth?

Hi all! I have the following schema: ```typescript model User { id String @id @default(cuid())...

How do I pass a custom error from my backend to frontend?

How do I pass a custom error from my backend to frontend?

T3 Stack Access Env Variables Without Prefix On Frontend

How do I access an env variable without the prefix on the frontend? I want to be able to use the same env variables across projects (Deploying on railway using environments) so how would I access the env variables on the frontend without the prefix

refresh token

How do I implement automatic refresh in t3? I found this link: https://github.com/TanStack/query/discussions/2770 but using trpc there's no where to specify "await refreshAuthToken()". Can't do it in "retry" either because it cannot be made async. Any help is greatly appreciated!

Using getServerSideProps vs TRPC in T3Stack

Hey quick thing, should I use getServerSideProps use or trpc.auth.getSession to check for auth when loading pages ?

How much cost Railway?

Can someone who has had experience with Railway.app give me an estimate of how much it costs? I'm looking now for the Developer Plan.

.default('') on Zod doing nothing

I have a validator for the profilePictureUrl that sets the default to an empty string.. or so I thought. I'm getting errors like:

typescript props as object or array

Hey guys, I have a select that can or not be a multi-select So my select props are ```ts type SelectProps = {...

Do I need an Explicit Many-To-Many Relation, when I want to have an ordered List in MySQL (Prisma)?

I would love to use an implicit many to many relation, but I do need the user to be able to order their items (drag them up & down) - will I really need to create an extra table just to store the order? Or is there some way I can accomplish that with an implicit many-to-many relation?

Jest test fails

Why is my jest mock failing here? ```ts import '@testing-library/jest-dom'; import React, { Fragment } from 'react'; ...

env variable fails for enum type

``/** * Specify your client-side environment variables schema here. * This way you can ensure the app isn't built with invalid env vars. * To expose them to the client, prefix them with NEXTPUBLIC`. */...

Passing color prop isn't working with custom button

```ts import React from "react"; type ButtonProps = { disabled?: boolean; onClick?: React.MouseEventHandler<HTMLButtonElement>;...

Is changing fields on Session regularly good or bad practice?

In this example, I've got a new field on the session.user object called activeTeamId. This is then used to decide which team data to display for a user on a homepage. It also is used to create some trpc middleware that checks info about the user and their permissions on that team (whether they have admin privileges, etc). When a user switches teams in the app, I was planning to just update this session.user.activeTeamId field. Noticed that updates the session don't seem to propagate throughout the app super reliably (have not done a deep dive to examine why), so I was just wondering if there is some reason this is generally a bad pattern to use. Thanks!...

if i spread input will explicit defining it override the spread input?

Example ```js .input({ z.object({ email: z.string(),...

Strange Prisma error when trying to seed -- meta { column_name 'for' }

I'm trying to seed the following table. ``` model Contract { id String @id @default(cuid()) dueDay Int? @map("due_date") @db.TinyInt() ...

in a create-t3-turbo app can i have util folder under packages folder? so it can be share all round

Is this a good practice ? If yes do i need any further config to get it working this is my 1st time using create-t3-turbo app And basically its just a function to send email...

Error with env variables

Hi, i'm experimenting with the /env folder t3-stack provides, and I am running into an issue wherin my environment variables aren't correctly loading in. I've added them to .env and the serverSchema and i'm using them in the project as an import from env/server.mjs. Am I doing something wrong? Thanks in advance...

Help! I'm building small wiki app with Prisma and being stuck at paginate function.

It's mind boggling that Prisma doesn't have something so common that is count total record for all page in paging. I search on on their GitHub and found out that they have this issue opened for 1 year, and in the mean time user have to query to database 2 times, 1 for count all and 1 for paginated data. This makes me wonder that which one is better, "count 300 records then get 20 records for 1 page" or "get all 300 records with no paging."? Is there any better way to solve this? Should I wait fo...

I need to implement a schedule system, any suggestions?

Hi! I just need to let users select availability in a 7 day format. In addition, I need to display a simple calendar that shows their appointments after scheduling is done. Perhaps with rescheduling abilities. I haven't done anything with calendars before, any suggestions for building my own simple system and/or using an existing API?...