NextJs trpcClient and merged router. But it is returning a html doc instead of json error.
trpcClient
and merged router,
in nextJs v15, app router.
When i implement trpc with api routes /api/v2/user/[user]/route.ts
and utils/trpc nexbacthlink /api/v2/user
. this code snippet is working fine.
...api/v2/[trpc]/route.ts
. It working now with this.getting type error in the code from https://trpc.io/docs/client/react/server-components

Type error when following guide TRPC React query: 'lazy' is declared here.
Type 'CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { users: CreateRouterInner<...>; }>' does not satisfy the constraint 'Router<any, any>'.
Types of property '_def' are incompatible.
Property 'lazy' is missing in type 'RouterDef<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { users: CreateRouterInner<...>; }, { ...; }>' but required in type '{ _config: RootConfig<any>; router: true; procedure?: undefined; procedures: any; record: any; lazy: Record<string, LazyLoader<AnyRouter>>; }'.
Type 'CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { users: CreateRouterInner<...>; }>' does not satisfy the constraint 'Router<any, any>'.
Types of property '_def' are incompatible.
Property 'lazy' is missing in type 'RouterDef<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { users: CreateRouterInner<...>; }, { ...; }>' but required in type '{ _config: RootConfig<any>; router: true; procedure?: undefined; procedures: any; record: any; lazy: Record<string, LazyLoader<AnyRouter>>; }'.

state change not triggering refetch
AppRouter nested routers/procedures are any when imported in monorepo
composite: true
in the api package as it was both used in web app for types and in api app.
What are the best practices for keeping TRPC and ts-server fast?
Weird data type when extending context in fetch adapter
tsconfig.worker.json
) references the following types:
```json
"types": [
"@cloudflare/workers-types/2023-07-01",
"./worker-configuration.d.ts",...FormData TRPCClientError
Private chat with TRPC
Router type = any in monorepo...
import type { AppRouter } from 'api'
) , the type of AppRouter is any
:/.
I've followed all the steps from the FAQ, but to no avail....Creating Service Layer in Next App Router
trpc/client.tsx
and trpc/server.tsx
, respectively). Since each of these has a unique way of interacting with the trpc endpoint, and the server.tsx
file is "server-only"
and cant be used in my client components, I'm not sure how I can go about making a service layer that is reused between client and server components.
My existing service layer handled the trpc call as well as other conversions to FE models, so I would really like to avoid duplicating this work from client and server components if possible. Does anyone know how I can achieve this?...Stream closed, but it returns the actual data
Cannot set headers after they are sent to the client
I'm trying to get type for queries/mutations returned from trpc use hooks, but they are different

tRPC useQuery waits for all queries—How to render ASAP?
File based structuring, trpc layout
How to wrap response type with useAsyncData from Nuxt?
useAsyncData(() => client.someProcedure.query())
on every call so that I don't double fetch during SSR. Is there a way to make a wrapper client that will wrap query and mutation responses with the useAsyncData()
call? I would love if the client was typed and I could call it the same way I can call the vanilla client.How to define per route staleTime on queryClient?
Can i use a single trpc proxy client in NextJS 12?
[Typescript] Client query/mutate has any type
