ensomnium
ensomnium
TtRPC
Created by ensomnium on 4/21/2023 in #❓-help
How to get unwrapped errors out of proxy client
I'm using sveltekit and in order to redirect from SSR you need to throw an error: https://kit.svelte.dev/docs/load#redirects TRPC wraps all errors in their custom type, so it's not easy to unpack this for svelte without a lot of boilerplate. I tried using custom fetch wrappers or links but it seems this happens further up and I can't easily catch the global error out of trpc (once again without wrapping). Is there an easy way to do this? Thanks!
2 replies
TtRPC
Created by ensomnium on 4/18/2023 in #❓-help
How does batching work in SSR & nextjs app directory?
I'm currently playing with the app directory for nextjs. If I have a SSR client set up like this:
export const client = createTRPCProxyClient<UserRouter>({
links: [
httpBatchLink({
url: 'http://localhost:4001/u'
}),
],
});
export const client = createTRPCProxyClient<UserRouter>({
links: [
httpBatchLink({
url: 'http://localhost:4001/u'
}),
],
});
Will batching happen on a per request basis or if there's multiple concurrent requests will it bleed batches together in certain cases?
1 replies