Simplifying SSR (e.g. in Next.JS)
useQuery
is being SSR (e.g. checking typeof window === 'undefined'
) and therefore await
the fetch call automatically and then pass it to initialData
to rehydrate on the client?...Type mismatch with queryClient prop of @trpc/react-query
Getting type error for AppRouter
Cloudflare worker subscriptions/websockets
Prevent client tsc from typechecking the server
import type { AppRouter } from "../../src/index.ts";
the tsc for the browser client tries to check the node server and throws errors like
```...Skew protection Vercel TRPC
Infer TRoot and TProcedure for specific procedures (polymorphism)
use cases
Why Trpc duplicates `shape` and `data` as duplicated JSON field on errors in `errorFormatter`?
procedure output is "any"
inferRouterClient<AppRouter>
I'm using 11.0.0-rc.648
and zod ^3.23.8
...Use TRPCClientError.cause in frontend
CartValidationError
In the frontend, I want to be able to do:
```...Inconsistent types for mutation return type
signIn
mutation that returns:
```
{
accessToken: string;...Possible to build this custom hook?
Hydration error when using useQuery instead of useSuspenseQuery when prefetching
tRPC 404 in Next.js API Routes
app/api/trpc/[trpc]/route.ts
```ts
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";...Best Monorepo Pattern for Sharing tRPC Logic Across Apps
Prefetch using Next App router not working with useQuery but works with useSuspenseQuery
tRPC Client Bundling `node_modules`
.pnpm
and node_modules
in @trpc/client
. This is causing a lot of errors as I'm not using pnpm:
<project>/node_modules/@trpc/client/dist/TRPCClientError.mjs
```js
import { _ as _define_property } from './node_modules/.pnpm/@swc_helpers@0.5.13/node_modules/@swc/helpers/esm/_define_property.mjs';...Context parameters in server side calls
createContext()
function is defined with the FetchCreateContextFnOptions
parameter signature, how do you fill that information out when using server side api calls, for example via createCaller
? The example in the docs is inaccurate in that it defines a createContext
function to require some parameters:
export const createContext = async (opts: CreateNextContextOptions) => { ... }
export const createContext = async (opts: CreateNextContextOptions) => { ... }