Sz
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Sz on 2/13/2024 in #questions
What exactly does `unstable_noStore` do?
I'm developing on the t3 stack with clerk as the auth. When I try to call one of my protected endpoints, I get the following error when building
I don't really understand why this error occurs when only the
auth
method is being used from Clerk in the trpc context, but using unstable_nostore
in the components that do call the endpoints, fixes this issue.
Does anyone know what exactly is going on here?3 replies
TTCTheo's Typesafe Cult
•Created by Sz on 1/31/2024 in #questions
Is it possible to create a component named Home in a NextJS project?
As the title states, I've been messing around with this one page I ported over from v0 and named the component
Home
. When I tried to import the component over to a page, it would stall and then eventually give a Maxium call stack
error.
Though I noticed that if I renamed it from Home to something else, the issue would be resolved and it would render properly.
Does anyone know what's going on here?
For context, It's a T3 app, but then stripped the parts from create-next-app
so that it supports bunx v0 add
functionality.2 replies
TTCTheo's Typesafe Cult
•Created by Sz on 12/13/2023 in #questions
Is it possible to pass access tokens to react server components?
I have an access token that's stored in local storage. Using the access token in client components is no problem since it has access to window, but for react server components this isn't the case.
Is there a way to pass in access tokens into react server components? Such as through a custom header?
4 replies
TTCTheo's Typesafe Cult
•Created by Sz on 12/12/2023 in #questions
Adding Custom Headers in trpc using local storage
Hey all, I'm trying to get add custom headers on the client side api of trpc, but have been struggling to do so.
Right now the setup currently looks like this
This doesn't work since the
trpcClient
gets initialized before the header
does in useEffect
and there doesn't seem to be a way to update the headers via the trpcClient.
Any advice would be apprecited!4 replies
TTCTheo's Typesafe Cult
•Created by Sz on 12/4/2023 in #questions
key paths for recursive nested types
Hey all, I have the following type
and am trying to build out a type that represents all the possible key paths that could be created through the nesting of properties or items.
I've tried a few patterns and have had chatGPT spit types out, but none of them seem to work. The closest thing I could get to was this
For now, I've settled to using regex through zod to represent the type
If anyone knows the solution to this, please do let me know
9 replies
TTCTheo's Typesafe Cult
•Created by Sz on 3/8/2023 in #questions
When developing locally, is there a purpose for having a Dev DB vs just having a local DB?
I'm reading through the planetscale documentation and they mention the differences between dev DB branches and production DB branches. It makes sense that to test the schema changes proposed in a staging/development branch before promoting to production, but would it ever make sense to connect to a dev DB when developing locally as opposed to just spinning up the db locally?
1 replies
TTCTheo's Typesafe Cult
•Created by Sz on 1/9/2023 in #questions
Recommended pattern for consolidating data in tRPC?
Hey all, is there a recommended pattern for consolidating data so that the format of the data in the output is consistent?
Currently building a standard t3 app and am considering using either links or a context dedicated to formatting the output of the data
1 replies
TTCTheo's Typesafe Cult
•Created by Sz on 1/2/2023 in #questions
How to handle multiple react-query `Providers`?
Working on a codebase that uses TRPC and a library called WAGMI that uses react-query. Since both TRPC and WAGMI provide their own
QueryClientProviders
I'm trying to figure out what the right way is to go about managing both of them7 replies