Makistos
Makistos
TtRPC
Created by Max on 4/1/2024 in #❓-help
Confused by the many examples and docs of implementing trpc, next.js (app router), and clerk.
And immediately I run into the same problem someone else here also had (and no-one had a solution) that transformer in createClient has moved somewhere else. Documentation unfortunately is next to useless. I can see exactly the same stuff in my IDE with code completion, i.e. there is absolutely no documentation in the documentation. For instance, tRPC examples tell to use createTRPCNext, but documenso doesn't use it. So what is it for? No idea because documentation only tells there is a function called it. It doesn't explain what it does or what the parameters do. I tried to fix the issue above and just got even harder issues. I assume transformer needs to be moved under links; httpLink (or httpBatchLink - what's the difference? Docs don't tell) but now I apparently need to define a transformer in my initTRPC-object first - I guess this should be in the initTRPC.create() function but I copied that from tRPC's example and there are no parameters used there. So what am I supposed to do here?
18 replies
TtRPC
Created by Max on 4/1/2024 in #❓-help
Confused by the many examples and docs of implementing trpc, next.js (app router), and clerk.
Ok, that looks useful. I'll have a look. Sorry to Max for hijacking your thread but hope that repository helps you too.
18 replies
TtRPC
Created by Max on 4/1/2024 in #❓-help
Confused by the many examples and docs of implementing trpc, next.js (app router), and clerk.
Problem is if and when I hit some snag I'd be pretty helpless because I'm not familiar with tRPC or SSR - something that already happened in fact.
18 replies
TtRPC
Created by Max on 4/1/2024 in #❓-help
Confused by the many examples and docs of implementing trpc, next.js (app router), and clerk.
Ok, so tRPC is not really usable right now if I want to start a new NextJS project.
18 replies
TtRPC
Created by Max on 4/1/2024 in #❓-help
Confused by the many examples and docs of implementing trpc, next.js (app router), and clerk.
Having read through the questions in this topic I don't think tRPC is a good choice with NextJS unless you are very knowledgeable about both. There seems to be lots of difficult issues that no-one can solve at the moment.
18 replies
TtRPC
Created by Max on 4/1/2024 in #❓-help
Confused by the many examples and docs of implementing trpc, next.js (app router), and clerk.
I think I got the switch to app router done, basically replace "pages" with app and the file structure is good to go but instead of _app.tsx you need to add the withTRPC wrapper to layout.tsx. There you export trpc.withTRPC(RootLayout).
18 replies
TtRPC
Created by Max on 4/1/2024 in #❓-help
Confused by the many examples and docs of implementing trpc, next.js (app router), and clerk.
Seems like I'm not the only one struggling with this. I'm trying to get SSR to work and even after enabling it I get an unhandled error that I shouldn't be using useState unless it's a Client Component. And this useState is somewhere inside trpc.
18 replies