Join the community to ask questions about tRPC and get answers from other members.

Join Server

setting up trpc in next 14

Pleaase I need help on how to integrate trpc in next js 14, please help me

migration trpc from pages to app router in Next.js

How can I migrate trpc from page route to app router

Have anyone tried migration from TRPC router to app router api

I was learning the trpc and I wanna know to go back and forth with trpc and restapi. can anyone know how to migrate from trpc to app router api route

Has anyone integrated trpc + udp (quic/webtransport api)?

Hi all, I'm thinking about taking advantage of quic for a certain part of my project. Basically I'm trying to capture user movement in 3d space, and I think udp might be a bit better to work with. Has anyone seen a trpc-link out there trying to do this? Has anyone experimented with this?
AGAlex Gomes11/30/2023

onSuccess invalidate

I'm trying to follow along with Theo's T3 tutorial using the latest Next version and the app router. The "setInput("")" and the invalidation don't seem to be working inside of onSuccess, the console.log is being called, what am I missing? Is this supposed to work? ```ts "use client"; ...

React Query client and caller client under one object

Would love to know if it is possible to have caller and react query clients under one object? I feel like it would be great to go api.cart.getCartItems() in server components that would utilise caller and api.card.getCartItems.useQuery() in client components....

I want to refetch and set the inital data of an useState

Hello guys, currently i am retrieving the data i use in useState with SSR, but i want to use somethinng that makes it possible to update the useState on interactions from the user. Im guessing I should use useQuery?
How can i set it so initialData in my useState works. this is my current useState line: ```tsx...

Vanilla Client Error Handling

What is the right way to handle errors when using the vanilla client? If I setup a client like so: ``` import type { Router } from '../../../server/src/routers'...
There is actually a docs page on this, does that answer the question?

sidebar search

Please how will I implement a search on the left sidebar to let the items on the search bar be searchable
No description

WS with TRPC

```ts │  Type '({ req, res, }: { req: Request; res: Response; }) => CreateInnerContextOpts' is not assignable to type 'NodeHTTPCreateContextFn<CreateRouterInner<RootConfig<{ ctx: CreateInnerContextOpts; meta: object; errorShape: { data: { zodError: typeToFlattenedError<any, string> | null; code: "PARSE_ERROR" | ... 13 more ... | "CLIENT_CLOSED_REQUEST"; httpStatus: number; path?: string | undefined; stack?: string | undefined; }; me...'. typescript (2322) [12, 3] │ Types of parameters '__0' and 'opts' are incompatible. │ Type 'NodeHTTPCreateContextFnOptions<IncomingMessage, WebSocket>' is not assignable to type '{ req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>; res: Response<any, Record<string, any>>; }'. │ Types of property 'req' are incompatible. ...

tRPC is butchering object types in return types

So if I have a mutation that returns this type
{ name?: string }
{ name?: string }
the type that tRPC infers for the mutation is...

Why my Authorization does not update ?

i have this in _app.tsx ```export default function App({ Component, pageProps }: AppProps) { return ( <> <Head> <title lang="en">Holistic Drop</title>...

TypeError: queryClient.getMutationDefaults is not a function (it is undefined)

Hi! There's not much code to show here, as I'm really not sure where the error actually occurs. In my React component I have:...

useQuery never returning or hitting API

I have something off in my configuration, i copied most of the files from the ❯ npm create t3-app@latest example app to add to an exisitng app. I am trying to call the simple post.hello and i tis working on the server. but when I call it on the client side like:
const postResult ={text:'Hello'});
const postResult ={text:'Hello'});

Type 'QueryClient' is missing the following properties from type 'QueryClient': queryCache, mutation

I am trying to setup a new project and doing my first client side query and getting this error:
Type 'QueryClient' is missing the following properties from type 'QueryClient': queryCache, mutationCache, logger, defaultOptions, and 4 more.
Type 'QueryClient' is missing the following properties from type 'QueryClient': queryCache, mutationCache, logger, defaultOptions, and 4 more.
This was due to a mismatch in the react-query version on my project.

trpc mutation call stuck

I have an issue with a simple mutation procedure: `getPublicUser: publicProcedure .input(z.object({ walletAddress: z.string()...

Create client based on OpenAPI

Hi! I am running a golang server with an openapi spec and would love to use trpc client in my frontend with my golang api. Is it possible to create a trpc client based on open API?

TRPC with react query, getting error twice?

When i am try to show TRPC error in the client side with react-query, i am getting error twice from ...batch=1&....., any idea?

Error building create-t3-app: Page couldn't be rendered statically because it used `cookies`

I get the following error when building create-t3-app:
TRPCClientError: Dynamic server usage: Page couldn't be rendered statically because it used `cookies`. See more info here:
TRPCClientError: Dynamic server usage: Page couldn't be rendered statically because it used `cookies`. See more info here: