Christian Lind
Christian Lind
TTCTheo's Typesafe Cult
Created by Christian Lind on 7/15/2023 in #questions
Rendered more hooks than during the previous render Typescript error
Hey, I have a parameter on my page that im loading with with router.query. This is what my code looks like const { studentId } = router.query; if (typeof studentId !== "string") { return null; } else { const studentQp = api.coach.getStudentQps.useQuery({ studentId: studentId, }); rest of my code.... I did it this way to ensure typesafety, but if i put all of the trpc querys at the beginning of the page, i get typescript errors because the type of studentId is not checked first How do i solve this?
23 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 7/10/2023 in #questions
Measure time user spends on my T3 website
Im trying to measure how many times and when users are logged into my website. Reason for this is that im building a website for studying and this would be a cool metric to show to my users. How could i achieve something like this in t3? Is there anyway i can use session data?
12 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 7/7/2023 in #questions
Weird typescript error
14 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 6/16/2023 in #questions
Inject react on a preexisting website for demo purposes
Im building a product that i want to demo for a client, its a little personal assistant. The product is built using react, and i would ideally like to host a version of their website locally, where i go on to insert my react code. Do you guys have any method that i could try to accomplish this? I tried using a proxymiddleware solution, but most websites seem to instanly redirect to their own websites and not staying on my local site.
3 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 6/12/2023 in #questions
Edge function exceeded 1mb
I got this error in vercel, using next.js v13.2, "Build Failed The Edge Function "index" size is 1.09 MB and your plan size limit is 1 MB." I guess that one of my pages are too large, but i can't figure out which one vercel is referring to since it's only telling me that index is too large which is a rather general name.
2 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 5/14/2023 in #questions
object might be undefined, but have a undefined check
13 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 5/11/2023 in #questions
Implement a forum on website
Im looking to add a forum onto my website, Do you guys know of any smart and easy way to do this, that has good integration to nextjs/t3 stack?
4 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 4/23/2023 in #questions
cache TRPC api query
Im building an api that returns the frequency of certain values from a mySQL database. These values dont get updated to often and would therefore like to cache the results somehow. Any tips on how i could do this best? Thought of simply using getStaticProps - but i need the data on a page that is server rendered so that option does not work.
1 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 4/21/2023 in #questions
Bad performance using planetscale, vercel, prisma
50 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 3/28/2023 in #questions
Is there a way to call a trpc useQuery() multiple times?
I have a list of objects, and i would like to call the useQuery 1 time for every object in order to get some deta. Is there a good way to do this?
33 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 2/25/2023 in #questions
Getting a possibly undefined after undefined check
60 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 2/23/2023 in #questions
Types have no overlap, but i have defined the type so that it does in fact have overlap
7 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 2/19/2023 in #questions
Incorporate Rust into t3 stack
Im wondering if there is a good way to incorporate rust into a t3 app? Want to experiment writing some apis in rust and hopefully seeing some performance boosts #blazinglyfast 🙂
13 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 2/17/2023 in #questions
type "number" cant be used to index list
17 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 2/10/2023 in #questions
Is it possible to encode tRPC data somehow?
I've built this webapp with t3 app and its mostly great - however i saw that all trpc data thats being sent from the backend can be found in the networks section of the chrome dev tools. Is there someway one can hide this - and at least make it a bit more tricky to get the data in raw form? There is no private data being sent - but access to the data in raw form is one of the largest moats of my product. Its taken a lot of time to assemble the data, and would be a shame if someone could just fetch it all using my site.
28 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 2/5/2023 in #questions
Protected routing premium user
I want to implement protected routes where a user needs to have a "premium" account to access it. How can i do this? I have implemented normal protected routes using getServerSideProps already
6 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 2/5/2023 in #questions
SOLVED | NextAuth build error | CLIENT_FETCH_ERROR
3 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 2/4/2023 in #questions
TS possibly undefined object
2 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 1/29/2023 in #questions
Unsafe return of any typed value, using prisma upsert
19 replies
TTCTheo's Typesafe Cult
Created by Christian Lind on 1/27/2023 in #questions
Pass different objects into same prop - TS error
Is it allowed to pass objects of different structure into the same prop, conditionally? Something like this if (case = "teacher") { return ( <div> <TeacherComponent person={teacher}/> </div> ); } else if (case = "student") { return ( <div> <StudentComponent person={student}/> </div> ); } Note that teacher and student have different properties and do not have the same structure. Typescript is getting mad at me when doing this 🙂
3 replies