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

Spotify login on Clerk not working on new users

Hey! I have a strange problem: If I try to login via Spotify with a user that already exists on clerk users everything goes fine. But if I try to login with a new user (new Spotify account) I am getting the following error: "Unable to complete action at this time. If the problem persists please contact support." Couldn't find anything about this online, but the stranger thing is that after brute force trying to login again and again with a new account it finally worked. Then I logged out , tried to login again with the same Spotify account (after only 1-2 minutes) and I got the error again....

TS not liking the post table

Hello. I am following Theo T3 Stack Tutorial - FROM 0 TO PROD and even though I do see T3 Stack has been updated. I am uncertain by once I add post, I get an error of Unsafe return of an any typed value.. I have reset my TS multiple times with no changes. All I did was change example out as it has been removed for post as return ctx.prisma.post.findMany();. Any advice is appreciated

What is the best practice for secret manager?

If I need to get secrets from AWS parameter store or Azure Key Vault, I have some approaches: 1. Inject when running the docker build, but less safe (https://devops.stackexchange.com/questions/3902/passing-secrets-to-a-docker-container/3904#comment8152_3904) 2. Always fetch the secret, but I'm not sure how to handle this properly. I may prefer the former....

Getting id of user with next-auth

I'm trying to set up next-auth with discord, but I can't get the user ID and discriminator. [..nextauth].ts ```js export default NextAuth({...

Trying to understand the purpose of keyword "number"

Hello I've been following the web tutorial that theo put out and Im at the part where he brings in a type from trpc and he defines that by putting in [number] at the end. I'm just confused on the significance of that keyword is that JavaScript thing. I have never seen it before. Im just looking for an explanation. Thanks

Edit default sign in form

Hello, I just want to know how to edit this form:
Solution:
This error is cause you’re missing a NEXTAuTH_SECRET

'Files' is possibly null

Below is where I implemented it ```const fetchPosts=useCallback(async()=>{
const { data:files } = await supabase .storage...
Solution:
Below is where I implemented it ```const fetchPosts=useCallback(async()=>{
const { data:files } = await supabase .storage...

NextJs Standalone mode, `publicRuntimeConfig`

What's the alternative to publicRuntimeConfig when using nextjs standalone mode? I run into a env prob where runtime envs are not getting pass into client. (only envs values during build are getting passed)....

I got some cart synchronization issues, what would you do?

Issue #1: Cart synchronization on the front end. Scenario:...

How to pull a single piece of data from Prisma using trpc

I'm working on an e-commerce site for a client using the t3 stack. I'm trying to create a product details page using the data from Prisma and planet scale and I haven't found a solution to getting a specific product. Any solutions to this would be greatly appreciated #questions

error in CRUD operations for DocumentDb

raw query failed. Code: unknown. Message: Command failed (): Feature not supported) at TRPCClientError.from (transformResult-6fb67924.mjs:4:1) at eval (httpBatchLink.mjs:190:40) c...

uploadthing limitation

I just saw Theo's video on youtube about upload file with uploadthing. I just wonder if this hosting file services have any limitation in file size or request per second

tRPC won't work in Production

For some reason, tRPC won't work in production. I have the schema updated in the main branch, on PlanetScale, and I know because I can see the most recent data. Logging in also works. But nothing else does. The error doesn't tell me anything, and everything works fine in a local environment, even if I connect to the main database. I think this is a Vercel problem, but I don't even know where to start debugging it...

tRPC suppressing server logs?

I noticed that when my tRPc mutation throws an error, the error is sent to the front end but nothing is logged from my server. Is there somewhere I need to update to print all exceptions?

Is it possible to store the oauth token in session but only on the server side?

Totally noob question here, but I want for the exercice to create an user interface for Spotify and so I've got a lot of call to the API of Spotify to make. And everytime I need the oauth token. But I don't want this to be accessible on the frontend side, just on the backend side. So storing it in the session doesn't look like the right way because it means it would be theoretically available on the client too? For now, I'm just doing everytime a request to the account database, but it looks clumsy as hell. What would be the proper way to do this? Thanks!...

tRPC - fetch params

Hello, how can i pass parameters to the query? I have tasks that need to be filled directly by an ID coming from a URL address. ...
Solution:
Hello, how can i pass parameters to the query? I have tasks that need to be filled directly by an ID coming from a URL address. ...

Prisma middleware infinite loop

Hey 👋 I have a separate table in my db that's responsible for storing logs of actions. I want to simplify the dx by creating a Prisma middleware that will automatically create these logs....

How to manage data for a AirTable clone

Im trying to build something like AirTable where the columns are customisable but I can't figure out how to keep the data efficiently. Any help would be appreciated ❤️...

How to type DynamoDB GetCommand

Hi all! I have something like this: ```typescript const response = await ddbDocClient.send(new GetCommand(input));...

does uploadthing have a progress bar?

I want to know if there is any way to get progress percentage on image/video loading for the project https://docs.uploadthing.com/