Nick
Nick
TtRPC
Created by pes04 on 5/8/2025 in #❓-help
Question about onError and modifying error messages in tRPC
PRs welcome! I’m surprised onError said “change” that’s definitely wrong
6 replies
TtRPC
Created by pes04 on 5/8/2025 in #❓-help
Question about onError and modifying error messages in tRPC
You want the errorFormatter
6 replies
TtRPC
Created by 00000 on 4/23/2025 in #❓-help
how can I set up trpc to work with nested providers?
The recommended approach would be SOA which we have an example for: https://github.com/trpc/trpc/tree/main/examples/soa
4 replies
TtRPC
Created by Peform on 5/3/2025 in #❓-help
trpc caching procedure calls for queries in the same batch
Just roll something so you store the first promise and return it to all other callers
9 replies
TtRPC
Created by Peform on 5/3/2025 in #❓-help
trpc caching procedure calls for queries in the same batch
I would put a cache in createContext and then have a middleware call it. That way the middleware instances rely on the same promise for each batch
9 replies
TtRPC
Created by Peform on 5/3/2025 in #❓-help
trpc caching procedure calls for queries in the same batch
if you end up horizontally scaling then the redis idea would probably be the way to go, but no need for extra infra for a single node
9 replies
TtRPC
Created by Peform on 5/3/2025 in #❓-help
trpc caching procedure calls for queries in the same batch
If you put the check in createContext then it will run once per batch. Alternatively you could use a singleton to de-duplicate and cache the checks but be careful to key it appropriately by user
9 replies
TtRPC
Created by venego on 5/3/2025 in #❓-help
How do I fetch data conditionally?
Prefetching or vanilla client then But updating some state which drives a useQuery is more react-query-like
13 replies
TtRPC
Created by venego on 5/3/2025 in #❓-help
How do I fetch data conditionally?
This is also a valid option depending on use case
13 replies
TtRPC
Created by venego on 5/3/2025 in #❓-help
How do I fetch data conditionally?
You can also use react query’s prefetching APIs
13 replies
TtRPC
Created by venego on 5/3/2025 in #❓-help
How do I fetch data conditionally?
It’s okay to use the vanilla client in the same app as the react query integration, you just won’t benefit from caching unless you manually update the cache
13 replies
TtRPC
Created by dylan42432 on 4/19/2025 in #❓-help
bigint
do you have a transformer set up?
2 replies
TtRPC
Created by jmac on 3/25/2025 in #❓-help
tRPC v11 FileLike
Thanks, could you pop this in a github issue? We can have a look then
7 replies
TtRPC
Created by jmac on 3/25/2025 in #❓-help
tRPC v11 FileLike
Without a reproduction (can just be a link to a random codebase on github or stackblitz) it’s hard to say if it’s your setup or our fault though
7 replies
TtRPC
Created by jmac on 3/25/2025 in #❓-help
tRPC v11 FileLike
Ahh we’re familiar with this type of error, it does pop up occasionally
7 replies
TtRPC
Created by datagutt on 2/24/2025 in #❓-help
skipToken combined with the new tanstack query options
This particular issue should be fixed, if you can reproduce a bug though please open a github issue with an example 🙂
10 replies
TtRPC
Created by Arxk on 3/27/2025 in #❓-help
Sending FormData does not work at all
Yes there is a minimal-content-types example in the repo
23 replies
TtRPC
Created by Arxk on 3/27/2025 in #❓-help
Sending FormData does not work at all
Hi all, I'm working on updating the docs for this, but hopefully this fragment helps in the mean-time:
import {
httpBatchLink,
httpLink,
isNonJsonSerializable,
splitLink,
} from '@trpc/client';

splitLink({
condition: (op) => isNonJsonSerializable(op.input),
true: httpLink({
url,
}),
false: httpBatchLink({
url,
}),
})
import {
httpBatchLink,
httpLink,
isNonJsonSerializable,
splitLink,
} from '@trpc/client';

splitLink({
condition: (op) => isNonJsonSerializable(op.input),
true: httpLink({
url,
}),
false: httpBatchLink({
url,
}),
})
23 replies
TtRPC
Created by Conviley on 4/9/2025 in #❓-help
Blob as response tRPC v.11
It's one we'd like to do in the future though
4 replies
TtRPC
Created by Conviley on 4/9/2025 in #❓-help
Blob as response tRPC v.11
Hi there, it's not currently possible to return blobs, these docs are referring to blobs as inputs
4 replies