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

Refetch minimum duration?

I wish to always keep data up to date and I use ```json { refetchOnMount: true, refetchOnWindowFocus: true,...

tRPC "Cannot destructure property 'client' of 'useContext(...)' as it is null"

i'm using create-t3-app. i'm trying to call my trpc endpoint from my frontend and i get
TypeError: Cannot destructure property 'client' of 'useContext(...)' as it is null.
TypeError: Cannot destructure property 'client' of 'useContext(...)' as it is null.
...

Clerk auth

Curious to hear what people have to say about Clerk, and if anyone have experienced any issues, or challenges while using it. Mainly for Expo now. I am looking into it now that I want more auth providers other than just email/password, and I want to hear from someone how's been using it for a while 🙂...

Anyone have any opinions on using Vitest or Jest for testing a NextJS + TS app?

Hey, Im building a Nextjs app with TS, NextAuth and Prisma. Just wondering if anyone has used Vitest and Jest in production and could give their opinion on them?

trick to handle potentially undefined values

In my user table age is optional So my code looks like ```javascript await ctx.prisma.user.create({ data:{...

best way to handle image upload in t3 stack

I Am trying to upload image to digital ocean space which is similar to s3 bucket But i would like to do it from the backend How i approach this before now i create a function on the front-end then i upload them from the front-end straight then return the url location to the backend but am scared of my keys been public ...

trpc useContext()

what is useContext and how to use it and why we should and whats the best case to use it

Dynamic page omit assertion of router.query

Hey , I am using an eslint rule that prevents me from invalid template literals. Is there anything I can do to omit pid as string ? ```ts import { useRouter } from 'next/router' const Post = () => { const router = useRouter()...

Getting ts-jest to work with testing files that use the .env mjs files

I'm trying to write a unit test to verify some code. This code uses the t3 env variable which is setup in these .mjs files. When I run jest it keeps failing to import from "./schema.mjs". Does anyone have an example repo which has test working fine in this scenario?

Make a button which downloads PDF

I know this is a noob question, but I haven't actually done this before. I have a nextjs web page. I want to make a button which downloads my resume as a pdf. How would I do this ?

Failed to load next.config.mjs

When I run my T3 App, It shows Failed to load next.config.mjs ```
frontend-new@0.1.0 dev next dev
...

Turborepo, Docker and multiple Nextjs Apps.

Hi guys, i need some help, i have a monorepo (turborepo) of nextjs proyects, and they have a lot of common dependencies like react, next, etc. So i'm trying to dockerize my monorepo, and trying to 1 only install common dependencies once and 2 trying to reduce the final image size of each service, i already try it nextjs standalone and fail 😦 . Anyone know how to fix this?

how can i useQuery() useMutation() in a useEffect

I have a response sensitive trpc(t3 stack) route With the current way t3 stack works this is a bad idea Because everything must be block scope i can wrap calls in useEffect to enable me determine when it should be triggered ...

create-t3-app and @next/font

Since @next/font is only available in next 13 is it advisable to update the 12.3.1 version of create-t3-app to latest or does it break anything? Are there any better alternatives to @next/font?

text editor

Where is the vod of Primeagen teaching Rust to Theo? I found the one were Theo teaches TS to Pg, but cant fin the other...

Working T3 project with websockets?

Does anyone have a project which where they successfully have used subscriptions. I'm find it quite difficult to implement.

Add permissions for `turbo dev...`

I am trying start a t3-turbo-and-clerk app and after pnpm i and pnpm dev I get this error: sh: /Users/daleblack/Library/CloudStorage/GoogleDrive-djblack@uci.edu/My Drive/dev/bible-mem/node_modules/.bin/turbo: Permission denied  ELIFECYCLE  Command failed with exit code 126. The app is located inside of a google drive folder which is streamed (not on harddrive), so I am guessing that's the issue. Any ideas how to solve this?...

Remove - Upload - Update

Hello all, I have a question regarding the correct flow to follow when doing these steps, the goal is this, a user can only have a profile picture, so first we check if that profile has a picture if it does delete it and then we upload the new one, then I try to fetch the new one that has been upload it, right now however this is not working as expected as I don't get the correct updatedDate url, perhaps I am missing something? after these steps are completed i use prisma to update the db and th...

Relations between Clerk Users with Prisma db

I've been using T3 for a few months now with nextAuth... I'm attempting to use Clerk with "t3-turbo-and-clerk". The part I'm getting real tripped up on is making relations between my prisma db and Clerk Users. With create-t3 / nextAuth, that nextAuth User table is in my schema and making relations is pretty brainless, but with Clerk hosting the Users, I'm not quite sure how to make that relation. Felt like a silly question to ask, but hopefully makes sense and someone can point me in the right direction! Thanks!...

Best practice for Admin dashboard?

I want to make an admin special page, but on the client side, I didn't know how to check if the user is admin, how can I do it? Should I check if the id from ctx is admin with getServerSideProps or should I check with trpc query? I want to do something like layout