Ahmed Elsakaan
Ahmed Elsakaan
TtRPC
Created by saloodpeepo on 5/24/2024 in #❓-help
trpc query help
Is the data fetching of the list of posts happening on the client side or the server side?
3 replies
TtRPC
Created by bill92 on 5/24/2024 in #❓-help
conditional useQuery without input
a query is enabled by default, so you don't need enabled: true
6 replies
TtRPC
Created by joseph on 12/31/2023 in #❓-help
TRPC & Zod Logging
I think you can do that in the errorFormatter method on the initTRPC.create function call, like so:
const t = initTRPC.context<Context>().create({
transformer: SuperJSON,
errorFormatter(opts) {
const { shape, error } = opts;

// log error
console.log(error);

return {
...shape,
data: {
...shape.data,
zodError:
error.code === 'BAD_REQUEST' && error.cause instanceof ZodError
? error.cause.flatten()
: null,
},
};
},
});
const t = initTRPC.context<Context>().create({
transformer: SuperJSON,
errorFormatter(opts) {
const { shape, error } = opts;

// log error
console.log(error);

return {
...shape,
data: {
...shape.data,
zodError:
error.code === 'BAD_REQUEST' && error.cause instanceof ZodError
? error.cause.flatten()
: null,
},
};
},
});
4 replies
TtRPC
Created by Zion on 12/29/2023 in #❓-help
tRPC and vite serverless, are there any exmaples?
apparently vite has a vercel plugin that allows you to do api endpoints like next.js
21 replies
TtRPC
Created by Zion on 12/29/2023 in #❓-help
tRPC and vite serverless, are there any exmaples?
21 replies
TtRPC
Created by Zion on 12/29/2023 in #❓-help
tRPC and vite serverless, are there any exmaples?
@julius 😜
21 replies
TtRPC
Created by Zion on 12/29/2023 in #❓-help
tRPC and vite serverless, are there any exmaples?
if it uses normal request/response you can hook up the trpc fetch adapter to it
21 replies
TtRPC
Created by Zion on 12/29/2023 in #❓-help
tRPC and vite serverless, are there any exmaples?
vite by default isn't a full stack type of tool, so it can't be compared with nextjs fully. What I would recommend if you're going with that route is to just have tRPC as it's own server using the standalone adapter and seeing if that works for you, you can use other adapters like fastify for example if you need something more than that.
21 replies
TtRPC
Created by taylor.presto on 11/18/2023 in #❓-help
I am getting a errors after starting a TRPC project with T3. "Unsafe return of an `any` typed value"
you didn’t use ctx at all
13 replies
TtRPC
Created by taylor.presto on 11/18/2023 in #❓-help
I am getting a errors after starting a TRPC project with T3. "Unsafe return of an `any` typed value"
its ctx.db not just db
13 replies
TtRPC
Created by ThatGuyJamal on 10/26/2023 in #❓-help
Disable trpc route cahce?
app router master
9 replies
TtRPC
Created by ThatGuyJamal on 10/26/2023 in #❓-help
Disable trpc route cahce?
hmm idk about that one tbh, @julius ?
9 replies
TtRPC
Created by ThatGuyJamal on 10/26/2023 in #❓-help
Disable trpc route cahce?
if you set cacheTime to 0 in your useQuery call options, it won’t cache the response
9 replies
TtRPC
Created by ThatGuyJamal on 10/26/2023 in #❓-help
Disable trpc route cahce?
this is because of react-query’s caching
9 replies
TtRPC
Created by v1narth on 8/7/2023 in #❓-help
Jest set cookie with caller
In the context?
5 replies
TtRPC
Created by isaac_way on 4/18/2023 in #❓-help
"This is likely not portable" error
but i completely forgot how i solved it
16 replies
TtRPC
Created by isaac_way on 4/18/2023 in #❓-help
"This is likely not portable" error
hmm i remember getting this error as well
16 replies
TtRPC
Created by magicspon on 4/17/2023 in #❓-help
Incorrect type errors
19 replies
TtRPC
Created by magicspon on 4/17/2023 in #❓-help
Incorrect type errors
why do you need to declare your own session type?
19 replies
TtRPC
Created by lukas on 4/10/2023 in #❓-help
Are TRPC server procedures actual endpoints? Meaning can you directly do a `post` request to them?
4 replies